1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-29 03:04:27 +01:00

* Converted rake to use YML config files for toolchain customization per CMock.

Need to figure out what to do about IAR MSP430

git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@24 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
This commit is contained in:
greg-williams
2009-04-11 14:42:09 +00:00
parent 5a35176ec8
commit c113a9caa0
15 changed files with 946 additions and 510 deletions

View File

@@ -1,77 +1,33 @@
$here = File.expand_path( File.dirname( __FILE__ ) )
HERE = File.expand_path(File.dirname(__FILE__)) + '/'
#require HERE + 'config/environment'
require 'rake'
require 'rake/clean'
require 'rake/loaders/makefile'
require 'fileutils'
require 'set'
require 'auto/unity_test_summary'
#USE THIS ONE IF YOU WANT TO TRY THIS WITH GCC
require 'rakefile_helper_GCC'
#USE THIS ONE IF YOU WANT TO TRY THIS WITH IAR
#require 'rakefile_helper_IAR'
require 'rake/testtask'
require 'rakefile_helper'
include RakefileHelpers
CLEAN.include('build/*')
# Load default configuration, for now
DEFAULT_CONFIG_FILE = 'gcc.yml'
configure_toolchain(DEFAULT_CONFIG_FILE)
desc "Build Unity and run tests."
task :default => [:clobber, :all]
desc "Build Unity object file."
task :build_unity => [:clobber, UNITY_OBJ]
task :run_test => [TEST_RESULTS, :summary].flatten
task :all => [UNITY_TEST_EXEC, :run_test]
task :unit do
run_tests get_unit_test_files
end
desc "Generate test summary"
task :summary do
flush_output
summary = UnityTestSummary.new
summary.set_root_path($here)
summary.set_targets(Dir["build/*.test*"])
summary.run
report_summary
end
file UNITY_OBJ => [UNITY_SRC, UNITY_HDR] do |obj|
compile UNITY_SRC, obj.name
end
desc "Build and test Unity"
task :all => [:clean, :unit, :summary]
task :default => [:clobber, :all]
task :ci => [:default]
task :cruise => [:default]
file UNITY_TEST_OBJ => [UNITY_TEST_SRC, UNITY_SRC, UNITY_HDR] do |obj|
compile UNITY_TEST_SRC, obj.name
desc "Load configuration"
task :config, :config_file do |t, args|
configure_toolchain(args[:config_file])
end
file UNITY_TEST_RUNNER_OBJ => [UNITY_TEST_RUNNER_SRC, UNITY_TEST_SRC, UNITY_SRC, UNITY_HDR] do |obj|
compile UNITY_TEST_RUNNER_SRC, obj.name
end
file UNITY_TEST_EXEC => [UNITY_OBJ, UNITY_TEST_OBJ, UNITY_TEST_RUNNER_OBJ] do |bin|
link bin.prerequisites, bin.name
end
rule /.*\.test/ => [BIN_EXTENSION] do |file|
bin = file.name.ext BIN_EXTENSION
test_results = 'build\sim.txt'
fail_file = file.name.ext 'testfail'
if File.exist?(fail_file)
rm_f fail_file
end
rm_f test_results
rm_f file.name
output = run_test bin
if !File.file?(test_results)
File.open(test_results, 'w') do |f|
f.print output
end
end
open test_results, 'r' do |f|
testoutput = f.read
if testoutput.index 'OK'
cp test_results, file.name
else
cp test_results, fail_file
end
end
end