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

Add ability to override name of the 'resetTest' function

This allows multiple groups to be compiled into the same executable by naming each function uniquely.
This commit is contained in:
elliot
2018-12-05 21:14:25 +00:00
committed by Elliot Gawthrop
parent 9ef1088eb7
commit 145691519b

View File

@@ -27,6 +27,7 @@ class UnityTestRunnerGenerator
mock_suffix: '',
setup_name: 'setUp',
teardown_name: 'tearDown',
test_reset_name: 'resetTest',
main_name: 'main', # set to :auto to automatically generate each time
main_export_decl: '',
cmdline_args: false,
@@ -322,8 +323,8 @@ class UnityTestRunnerGenerator
def create_reset(output, used_mocks)
output.puts("\n/*=======Test Reset Option=====*/")
output.puts('void resetTest(void);')
output.puts('void resetTest(void)')
output.puts("void #{@options[:test_reset_name]}(void);")
output.puts("void #{@options[:test_reset_name]}(void)")
output.puts('{')
output.puts(' CMock_Verify();') unless used_mocks.empty?
output.puts(' CMock_Destroy();') unless used_mocks.empty?
@@ -457,6 +458,7 @@ if $0 == __FILE__
' --teardown_name="" - redefine tearDown func name to something else',
' --main_name="" - redefine main func name to something else',
' --test_prefix="" - redefine test prefix from default test|spec|should',
' --test_reset_name="" - redefine resetTest func name to something else',
' --suite_setup="" - code to execute for setup of entire suite',
' --suite_teardown="" - code to execute for teardown of entire suite',
' --use_param_tests=1 - enable parameterized tests (disabled by default)',
@@ -468,4 +470,4 @@ if $0 == __FILE__
ARGV[1] = ARGV[0].gsub('.c', '_Runner.c') unless ARGV[1]
UnityTestRunnerGenerator.new(options).run(ARGV[0], ARGV[1])
end
end