mirror of
https://github.com/ThrowTheSwitch/Unity.git
synced 2026-01-30 19:54:26 +01:00
- 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
This commit is contained in:
@@ -75,9 +75,14 @@ class UnityTestRunnerGenerator
|
|||||||
lines.each_with_index do |line, index|
|
lines.each_with_index do |line, index|
|
||||||
#find tests
|
#find tests
|
||||||
if line =~ /^((?:\s*TEST_CASE\s*\(.*?\)\s*)*)\s*void\s+(test.*?)\s*\(\s*(.*)\s*\)/
|
if line =~ /^((?:\s*TEST_CASE\s*\(.*?\)\s*)*)\s*void\s+(test.*?)\s*\(\s*(.*)\s*\)/
|
||||||
|
arguments = $1
|
||||||
name = $2
|
name = $2
|
||||||
call = $3
|
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_and_line_numbers << { :name => name, :args => args, :call => call, :line_number => 0 }
|
||||||
tests_args = []
|
tests_args = []
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void tearDown(void)
|
|||||||
|
|
||||||
TEST_CASE(0)
|
TEST_CASE(0)
|
||||||
TEST_CASE(44)
|
TEST_CASE(44)
|
||||||
TEST_CASE(99)
|
TEST_CASE((90)+9)
|
||||||
void test_TheseShouldAllPass(int Num)
|
void test_TheseShouldAllPass(int Num)
|
||||||
{
|
{
|
||||||
TEST_ASSERT_TRUE(Num < 100);
|
TEST_ASSERT_TRUE(Num < 100);
|
||||||
@@ -60,7 +60,7 @@ void test_TheseShouldAllPass(int Num)
|
|||||||
|
|
||||||
TEST_CASE(3)
|
TEST_CASE(3)
|
||||||
TEST_CASE(77)
|
TEST_CASE(77)
|
||||||
TEST_CASE(99)
|
TEST_CASE( (99) + 1 - (1))
|
||||||
void test_TheseShouldAllFail(int Num)
|
void test_TheseShouldAllFail(int Num)
|
||||||
{
|
{
|
||||||
EXPECT_ABORT_BEGIN
|
EXPECT_ABORT_BEGIN
|
||||||
|
|||||||
Reference in New Issue
Block a user