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

auto: Only create run_test() function if it's needed.

Also fix some whitespace consistency issues.
Use 2 newlines (not 1 or 3) before /*====Heading====*/ comments.
This commit is contained in:
John Lindgren
2019-12-10 13:24:14 -05:00
parent 5e3fb620fb
commit f39c856a37
2 changed files with 7 additions and 6 deletions

View File

@@ -92,7 +92,7 @@ class UnityTestRunnerGenerator
create_suite_setup(output)
create_suite_teardown(output)
create_reset(output)
create_run_test(output)
create_run_test(output) unless tests.empty?
create_args_wrappers(output, tests)
create_main(output, input_file, tests, used_mocks)
end
@@ -325,8 +325,8 @@ class UnityTestRunnerGenerator
def create_run_test(output)
require 'erb'
template = ERB.new(File.read(File.join(__dir__, 'run_test.erb')))
output.puts(template.result(binding))
template = ERB.new(File.read(File.join(__dir__, 'run_test.erb')), nil, '<>')
output.puts("\n" + template.result(binding))
end
def create_args_wrappers(output, tests)
@@ -346,7 +346,7 @@ class UnityTestRunnerGenerator
end
def create_main(output, filename, tests, used_mocks)
output.puts("\n\n/*=======MAIN=====*/")
output.puts("\n/*=======MAIN=====*/")
main_name = @options[:main_name].to_sym == :auto ? "main_#{filename.gsub('.c', '')}" : (@options[:main_name]).to_s
if @options[:cmdline_args]
if main_name != 'main'