1
0
mirror of https://github.com/ThrowTheSwitch/Unity.git synced 2026-01-23 00:15:58 +01:00

- unity_test_summary script callable from command line again

- fixed obj_file sorting in rakefiles
- gave better anchors for gcc to grab on test pass/fail by breaking them out as functions
- fixed minor type issues

git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@137 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
This commit is contained in:
mvandervoord
2012-01-02 21:38:36 +00:00
parent 3a82e1eeab
commit d0d5ec5d75
6 changed files with 62 additions and 41 deletions

View File

@@ -87,10 +87,11 @@ module RakefileHelpers
def compile(file, defines=[])
compiler = build_compiler_fields
cmd_str = "#{compiler[:command]}#{compiler[:defines]}#{compiler[:options]}#{compiler[:includes]} #{file} " +
"#{$cfg['compiler']['object_files']['prefix']}#{$cfg['compiler']['object_files']['destination']}" +
"#{File.basename(file, C_EXTENSION)}#{$cfg['compiler']['object_files']['extension']}"
execute(cmd_str)
cmd_str = "#{compiler[:command]}#{compiler[:defines]}#{compiler[:options]}#{compiler[:includes]} #{file} " +
"#{$cfg['compiler']['object_files']['prefix']}#{$cfg['compiler']['object_files']['destination']}"
obj_file = "#{File.basename(file, C_EXTENSION)}#{$cfg['compiler']['object_files']['extension']}"
execute(cmd_str + obj_file)
return obj_file
end
def build_linker_fields
@@ -181,8 +182,7 @@ module RakefileHelpers
# Compile corresponding source file if it exists
src_file = find_source_file(header, include_dirs)
if !src_file.nil?
compile(src_file, test_defines)
obj_list << header.ext($cfg['compiler']['object_files']['extension'])
obj_list << compile(src_file, test_defines)
end
end
@@ -197,12 +197,10 @@ module RakefileHelpers
runner_path = $cfg['compiler']['runner_path'] + runner_name
end
compile(runner_path, test_defines)
obj_list << runner_name.ext($cfg['compiler']['object_files']['extension'])
obj_list << compile(runner_path, test_defines)
# Build the test module
compile(test, test_defines)
obj_list << test_base.ext($cfg['compiler']['object_files']['extension'])
obj_list << compile(test, test_defines)
# Link the test executable
link_it(test_base, obj_list)
@@ -239,15 +237,13 @@ module RakefileHelpers
extract_headers(main_path).each do |header|
src_file = find_source_file(header, include_dirs)
if !src_file.nil?
compile(src_file)
obj_list << header.ext($cfg['compiler']['object_files']['extension'])
obj_list << compile(src_file)
end
end
# Build the main source file
main_base = File.basename(main_path, C_EXTENSION)
compile(main_path)
obj_list << main_base.ext($cfg['compiler']['object_files']['extension'])
obj_list << compile(main_path)
# Create the executable
link_it(main_base, obj_list)