提交 3e472491 编写于 作者: M mvandervoord

- added ability to parse fun characters like parenthesis in TEST_CASES

- fixed TEST_CASE error

git-svn-id: http://unity.svn.sourceforge.net/svnroot/unity/trunk@115 e7d17a6e-8845-0410-bbbc-c8efb4fdad7e
上级 aca98924
......@@ -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
......
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册