未验证 提交 2697770a 编写于 作者: M Mark VanderVoord 提交者: GitHub

Merge pull request #379 from elliot-gawthrop/auto-runner-args

Redefine name of resetTest in generated runner
......@@ -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
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册