mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-10-01 06:27:22 +00:00
Merge pull request #841 from 94xhn/fix/omit-begin-end-suite-teardown
Fix custom suite teardown with omitted begin/end
This commit is contained in:
@@ -592,7 +592,7 @@ class UnityTestRunnerGenerator
|
|||||||
output.puts(' CMock_Guts_MemFreeFinal();') unless used_mocks.empty?
|
output.puts(' CMock_Guts_MemFreeFinal();') unless used_mocks.empty?
|
||||||
if @options[:has_suite_teardown]
|
if @options[:has_suite_teardown]
|
||||||
if @options[:omit_begin_end]
|
if @options[:omit_begin_end]
|
||||||
output.puts(' (void) suite_teardown(0);')
|
output.puts(' (void) suiteTearDown(0);')
|
||||||
else
|
else
|
||||||
output.puts(' return suiteTearDown(UNITY_END());')
|
output.puts(' return suiteTearDown(UNITY_END());')
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ Significant Bugfixes:
|
|||||||
- display of failures fixed on ARM processors, particularly with arrays (#807)
|
- display of failures fixed on ARM processors, particularly with arrays (#807)
|
||||||
- fixed each-equal assertion for memory (#797)
|
- fixed each-equal assertion for memory (#797)
|
||||||
- fix many warnings.
|
- fix many warnings.
|
||||||
|
- Test runner generator calls custom suite teardown when begin/end calls are omitted. @94xhn
|
||||||
|
|
||||||
Other:
|
Other:
|
||||||
|
|
||||||
|
|||||||
@@ -1314,6 +1314,26 @@ def verify_number(expected, expression, output)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should 'GenerateSuiteTeardownWhenBeginAndEndAreOmitted' do
|
||||||
|
runner_name = OUT_FILE + 'SuiteTeardownWithoutBeginEnd_runner.c'
|
||||||
|
UnityTestRunnerGenerator.new(
|
||||||
|
:test_prefix => 'test',
|
||||||
|
:suite_teardown => ' return num_failures;',
|
||||||
|
:omit_begin_end => true,
|
||||||
|
).run('testdata/testRunnerGenerator.c', runner_name)
|
||||||
|
|
||||||
|
runner = File.read(runner_name)
|
||||||
|
correct_call = runner.include?('(void) suiteTearDown(0);')
|
||||||
|
incorrect_call = runner.include?('(void) suite_teardown(0);')
|
||||||
|
if correct_call && !incorrect_call
|
||||||
|
report 'Runner_GenerateSuiteTeardownWhenBeginAndEndAreOmitted:PASS'
|
||||||
|
else
|
||||||
|
report 'Runner_GenerateSuiteTeardownWhenBeginAndEndAreOmitted:FAIL'
|
||||||
|
$generate_test_runner_failures += 1
|
||||||
|
end
|
||||||
|
$generate_test_runner_tests += 1
|
||||||
|
end
|
||||||
|
|
||||||
RUNNER_TESTS.each do |testset|
|
RUNNER_TESTS.each do |testset|
|
||||||
basename = File.basename(testset[:testfile], C_EXTENSION)
|
basename = File.basename(testset[:testfile], C_EXTENSION)
|
||||||
testset_name = "Runner_#{basename}_#{testset[:name]}"
|
testset_name = "Runner_#{basename}_#{testset[:name]}"
|
||||||
|
|||||||
Reference in New Issue
Block a user