Ram Gandikota
/
IOTMetronome
FRDM K64F Metronome
pal/Test/Unity/test/rakefile@0:dbad57390bd1, 2017-05-14 (annotated)
- Committer:
- ram54288
- Date:
- Sun May 14 18:37:05 2017 +0000
- Revision:
- 0:dbad57390bd1
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ram54288 | 0:dbad57390bd1 | 1 | # ========================================== |
ram54288 | 0:dbad57390bd1 | 2 | # Unity Project - A Test Framework for C |
ram54288 | 0:dbad57390bd1 | 3 | # Copyright (c) 2007 Mike Karlesky, Mark VanderVoord, Greg Williams |
ram54288 | 0:dbad57390bd1 | 4 | # [Released under MIT License. Please refer to license.txt for details] |
ram54288 | 0:dbad57390bd1 | 5 | # ========================================== |
ram54288 | 0:dbad57390bd1 | 6 | |
ram54288 | 0:dbad57390bd1 | 7 | UNITY_ROOT = File.expand_path(File.dirname(__FILE__)) + '/' |
ram54288 | 0:dbad57390bd1 | 8 | |
ram54288 | 0:dbad57390bd1 | 9 | require 'rake' |
ram54288 | 0:dbad57390bd1 | 10 | require 'rake/clean' |
ram54288 | 0:dbad57390bd1 | 11 | require UNITY_ROOT + 'rakefile_helper' |
ram54288 | 0:dbad57390bd1 | 12 | |
ram54288 | 0:dbad57390bd1 | 13 | TEMP_DIRS = [ |
ram54288 | 0:dbad57390bd1 | 14 | File.join(UNITY_ROOT, 'build') |
ram54288 | 0:dbad57390bd1 | 15 | ] |
ram54288 | 0:dbad57390bd1 | 16 | |
ram54288 | 0:dbad57390bd1 | 17 | TEMP_DIRS.each do |dir| |
ram54288 | 0:dbad57390bd1 | 18 | directory(dir) |
ram54288 | 0:dbad57390bd1 | 19 | CLOBBER.include(dir) |
ram54288 | 0:dbad57390bd1 | 20 | end |
ram54288 | 0:dbad57390bd1 | 21 | |
ram54288 | 0:dbad57390bd1 | 22 | task :prepare_for_tests => TEMP_DIRS |
ram54288 | 0:dbad57390bd1 | 23 | |
ram54288 | 0:dbad57390bd1 | 24 | include RakefileHelpers |
ram54288 | 0:dbad57390bd1 | 25 | |
ram54288 | 0:dbad57390bd1 | 26 | # Load proper GCC as defult configuration |
ram54288 | 0:dbad57390bd1 | 27 | DEFAULT_CONFIG_FILE = 'gcc_auto_stdint.yml' |
ram54288 | 0:dbad57390bd1 | 28 | configure_toolchain(DEFAULT_CONFIG_FILE) |
ram54288 | 0:dbad57390bd1 | 29 | |
ram54288 | 0:dbad57390bd1 | 30 | desc "Test unity with its own unit tests" |
ram54288 | 0:dbad57390bd1 | 31 | task :unit => [:prepare_for_tests] do |
ram54288 | 0:dbad57390bd1 | 32 | run_tests get_unit_test_files |
ram54288 | 0:dbad57390bd1 | 33 | end |
ram54288 | 0:dbad57390bd1 | 34 | |
ram54288 | 0:dbad57390bd1 | 35 | desc "Test unity's helper scripts" |
ram54288 | 0:dbad57390bd1 | 36 | task :scripts => [:prepare_for_tests] do |
ram54288 | 0:dbad57390bd1 | 37 | Dir['tests/test_*.rb'].each do |scriptfile| |
ram54288 | 0:dbad57390bd1 | 38 | require "./"+scriptfile |
ram54288 | 0:dbad57390bd1 | 39 | end |
ram54288 | 0:dbad57390bd1 | 40 | end |
ram54288 | 0:dbad57390bd1 | 41 | |
ram54288 | 0:dbad57390bd1 | 42 | desc "Generate test summary" |
ram54288 | 0:dbad57390bd1 | 43 | task :summary do |
ram54288 | 0:dbad57390bd1 | 44 | report_summary |
ram54288 | 0:dbad57390bd1 | 45 | end |
ram54288 | 0:dbad57390bd1 | 46 | |
ram54288 | 0:dbad57390bd1 | 47 | desc "Build and test Unity" |
ram54288 | 0:dbad57390bd1 | 48 | task :all => [:clean, :prepare_for_tests, :scripts, :unit, :summary] |
ram54288 | 0:dbad57390bd1 | 49 | task :default => [:clobber, :all] |
ram54288 | 0:dbad57390bd1 | 50 | task :ci => [:no_color, :default] |
ram54288 | 0:dbad57390bd1 | 51 | task :cruise => [:no_color, :default] |
ram54288 | 0:dbad57390bd1 | 52 | |
ram54288 | 0:dbad57390bd1 | 53 | desc "Load configuration" |
ram54288 | 0:dbad57390bd1 | 54 | task :config, :config_file do |t, args| |
ram54288 | 0:dbad57390bd1 | 55 | configure_toolchain(args[:config_file]) |
ram54288 | 0:dbad57390bd1 | 56 | end |
ram54288 | 0:dbad57390bd1 | 57 | |
ram54288 | 0:dbad57390bd1 | 58 | task :no_color do |
ram54288 | 0:dbad57390bd1 | 59 | $colour_output = false |
ram54288 | 0:dbad57390bd1 | 60 | end |