diff --git a/auto/generate_test_runner.rb b/auto/generate_test_runner.rb index 2d4ac33022c45786eac13385f0c2434397aa4bcd..40d73c6f3fb5c952ad3c20ab029ba2460641c1b9 100644 --- a/auto/generate_test_runner.rb +++ b/auto/generate_test_runner.rb @@ -75,9 +75,14 @@ class UnityTestRunnerGenerator lines.each_with_index do |line, index| #find tests if line =~ /^((?:\s*TEST_CASE\s*\(.*?\)\s*)*)\s*void\s+(test.*?)\s*\(\s*(.*)\s*\)/ + arguments = $1 name = $2 call = $3 - args = (@options[:use_param_tests] and $1) ? ($1.gsub(/\s*TEST_CASE\s*\(\s*/,'').strip.split(/\s*\)/).compact) : nil + args = nil + if (@options[:use_param_tests] and !arguments.empty?) + args = [] + arguments.scan(/\s*TEST_CASE\s*\((.*)\)\s*$/) {|a| args << a[0]} + end tests_and_line_numbers << { :name => name, :args => args, :call => call, :line_number => 0 } tests_args = [] end diff --git a/test/testparameterized.c b/test/testparameterized.c index a267e9f4be11dd0cfd72187a3aa770a42e4d6dd8..3192c5d400f13026da0b27021670461147820334 100644 --- a/test/testparameterized.c +++ b/test/testparameterized.c @@ -52,7 +52,7 @@ void tearDown(void) TEST_CASE(0) TEST_CASE(44) -TEST_CASE(99) +TEST_CASE((90)+9) void test_TheseShouldAllPass(int Num) { TEST_ASSERT_TRUE(Num < 100); @@ -60,7 +60,7 @@ void test_TheseShouldAllPass(int Num) TEST_CASE(3) TEST_CASE(77) -TEST_CASE(99) +TEST_CASE( (99) + 1 - (1)) void test_TheseShouldAllFail(int Num) { EXPECT_ABORT_BEGIN