mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-28 10:44:26 +01:00
- separated generate step in test runner generator
git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@128 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
This commit is contained in:
@@ -45,6 +45,16 @@ class UnityTestRunnerGenerator
|
|||||||
end
|
end
|
||||||
|
|
||||||
#build runner file
|
#build runner file
|
||||||
|
generate(input_file, output_file, tests, includes, used_mocks)
|
||||||
|
|
||||||
|
#determine which files were used to return them
|
||||||
|
all_files_used = [input_file, output_file]
|
||||||
|
all_files_used += includes.map {|filename| filename + '.c'} unless includes.empty?
|
||||||
|
all_files_used += @options[:includes] unless @options[:includes].empty?
|
||||||
|
return all_files_used.uniq
|
||||||
|
end
|
||||||
|
|
||||||
|
def generate(input_file, output_file, tests, includes, used_mocks)
|
||||||
File.open(output_file, 'w') do |output|
|
File.open(output_file, 'w') do |output|
|
||||||
create_header(output, used_mocks)
|
create_header(output, used_mocks)
|
||||||
create_externs(output, tests, used_mocks)
|
create_externs(output, tests, used_mocks)
|
||||||
@@ -53,11 +63,6 @@ class UnityTestRunnerGenerator
|
|||||||
create_reset(output, used_mocks)
|
create_reset(output, used_mocks)
|
||||||
create_main(output, input_file, tests)
|
create_main(output, input_file, tests)
|
||||||
end
|
end
|
||||||
|
|
||||||
all_files_used = [input_file, output_file]
|
|
||||||
all_files_used += includes.map {|filename| filename + '.c'} unless includes.empty?
|
|
||||||
all_files_used += @options[:includes] unless @options[:includes].empty?
|
|
||||||
return all_files_used.uniq
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def find_tests(input_file)
|
def find_tests(input_file)
|
||||||
|
|||||||
Reference in New Issue
Block a user