Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions detection.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ find_fail(){
file=$2
suite_line=$(cat "$file" | grep "$target")
if echo "$suite_line" | grep "failures=\"0\"";then
if echo "$suite_line" | grep -L "errors=\"0\"";then
return 0
else
if echo "$suite_line" | grep -L "errors=\"[1-9]\d*\"";then
echo "Error found in $file: $suite_line"
return 1
else
return 0
fi
elif echo "$suite_line" | grep -L "errors=\"0\"";then
if echo "$suite_line" | grep "failures=\"0\"";then
return 0
else
if echo "$suite_line" | grep -L "failures=\"[1-9]\d*\"";then
echo "Error found in $file: $suite_line"
return 1
else
return 0
fi
else
echo "Failure found in $file: $suite_line"
Expand Down
4 changes: 4 additions & 0 deletions test/all.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ test/one.sh test/failure_fixture.xml 1
test/one.sh test/singular_testsuite_success_fixture.xml 0
test/one.sh test/singular_testsuite_failure_fixture.xml 1
test/one.sh test/error_fixture.xml 1
test/one.sh test/no_error_field_fixture_success.xml 0
test/one.sh test/no_error_field_fixture_failure.xml 1

test/one.sh test 1
test/one.sh test/success 0
test/one.sh test/failure 1
test/one.sh test/error 1
test/one.sh missing.xml 0
test/one.sh test/missing.xml 0
test/one.sh test/no_error_field_fixture.xml 0
test/one.sh test/no_error_field_fixture_failure.xml 1
22 changes: 22 additions & 0 deletions test/no_error_field_fixture_failure.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="5" failures="1" disabled="0" timestamp="2020-06-05T02:02:29" time="0.002" name="AllTests">
<testsuite name="StrCompare" tests="5" failures="2" disabled="0" errors="0" time="0.002">
<testcase name="CStrEqual" status="run" time="0" classname="StrCompare" />
<testcase name="CStrEqual2" status="run" time="0" classname="StrCompare" />
<testcase name="CStrEqual3" status="run" time="0" classname="StrCompare" />
<testcase name="CStrNotEqual" status="run" time="0" classname="StrCompare">
<failure message="/github/workspace/catkin_ws/src/am_super/test/sample_tests.cpp:27&#x0A; Expected: expectVal&#x0A; Which is: &quot;hello gtest&quot;&#x0A;To be equal to: actualValFalse&#x0A; Which is: &quot;hello world&quot;" type=""><![CDATA[/github/workspace/catkin_ws/src/am_super/test/sample_tests.cpp:27
Expected: expectVal
Which is: "hello gtest"
To be equal to: actualValFalse
Which is: "hello world"]]></failure>
</testcase>
<testcase name="CStrNotEqual4" status="run" time="0.002" classname="StrCompare">
<failure message="/github/workspace/catkin_ws/src/am_super/test/sample_tests.cpp:32&#x0A; Expected: expectVal&#x0A; Which is: &quot;hello gtest&quot;&#x0A;To be equal to: actualValFalse&#x0A; Which is: &quot;hello world&quot;" type=""><![CDATA[/github/workspace/catkin_ws/src/am_super/test/sample_tests.cpp:32
Expected: expectVal
Which is: "hello gtest"
To be equal to: actualValFalse
Which is: "hello world"]]></failure>
</testcase>
</testsuite>
</testsuites>
22 changes: 22 additions & 0 deletions test/no_error_field_fixture_success.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites tests="5" failures="0" disabled="0" timestamp="2020-06-05T02:02:29" time="0.002" name="AllTests">
<testsuite name="StrCompare" tests="5" failures="2" disabled="0" errors="0" time="0.002">
<testcase name="CStrEqual" status="run" time="0" classname="StrCompare" />
<testcase name="CStrEqual2" status="run" time="0" classname="StrCompare" />
<testcase name="CStrEqual3" status="run" time="0" classname="StrCompare" />
<testcase name="CStrNotEqual" status="run" time="0" classname="StrCompare">
<failure message="/github/workspace/catkin_ws/src/am_super/test/sample_tests.cpp:27&#x0A; Expected: expectVal&#x0A; Which is: &quot;hello gtest&quot;&#x0A;To be equal to: actualValFalse&#x0A; Which is: &quot;hello world&quot;" type=""><![CDATA[/github/workspace/catkin_ws/src/am_super/test/sample_tests.cpp:27
Expected: expectVal
Which is: "hello gtest"
To be equal to: actualValFalse
Which is: "hello world"]]></failure>
</testcase>
<testcase name="CStrNotEqual4" status="run" time="0.002" classname="StrCompare">
<failure message="/github/workspace/catkin_ws/src/am_super/test/sample_tests.cpp:32&#x0A; Expected: expectVal&#x0A; Which is: &quot;hello gtest&quot;&#x0A;To be equal to: actualValFalse&#x0A; Which is: &quot;hello world&quot;" type=""><![CDATA[/github/workspace/catkin_ws/src/am_super/test/sample_tests.cpp:32
Expected: expectVal
Which is: "hello gtest"
To be equal to: actualValFalse
Which is: "hello world"]]></failure>
</testcase>
</testsuite>
</testsuites>