Committer:
leothedragon
Date:
Sun Apr 18 15:20:23 2021 +0000
Revision:
0:25fa8795676b
DS

Who changed what in which revision?

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