-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve test reliability, output test results consumable by Jenkins
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
- Loading branch information
Showing
7 changed files
with
71 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This script is part of the unit test mechanism for ign-tools. | ||
execute_process(COMMAND ruby ${IGN_SCRIPT} | ||
${TEST_NAME} | ||
OUTPUT_VARIABLE TEST_OUTPUT | ||
ERROR_VARIABLE TEST_ERROR) | ||
|
||
# Copy failure result everytime we run test so we don't accidentally use | ||
# previous results. | ||
execute_process(COMMAND | ||
${CMAKE_COMMAND} -E copy | ||
"${TEST_NAME}_fail.xml" | ||
"../test_results/${TEST_NAME}.xml" | ||
) | ||
|
||
if (${TEST_OUTPUT} MATCHES "Test executed" AND NOT | ||
((${TEST_OUTPUT} MATCHES "Library error") OR | ||
(${TEST_ERROR} MATCHES "Library error"))) | ||
execute_process(COMMAND | ||
${CMAKE_COMMAND} -E copy | ||
"${TEST_NAME}_pass.xml" | ||
"../test_results/${TEST_NAME}.xml" | ||
) | ||
else() | ||
message(FATAL_ERROR "Failed test. | ||
Output: ${TEST_OUTPUT} | ||
Error: ${TEST_ERROR}") | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ class Cmd | |
# Execute the command | ||
# | ||
def execute(args) | ||
puts "Test passed" | ||
puts "Test executed" | ||
end | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<testsuites tests="1" failures="1" disabled="0" errors="0" timestamp="@TEST_TIME@" time="0" name="AllTests"> | ||
<testsuite name="@TEST_NAME@" tests="1" failures="1" disabled="0" errors="0" time="0"> | ||
<testcase name="ign_script" status="run" time="0" classname="@TEST_NAME@"> | ||
<failure type="Standard" message="@TEST_NAME@ failed." /> | ||
</testcase> | ||
</testsuite> | ||
</testsuites> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<testsuites tests="1" failures="0" disabled="0" errors="0" timestamp="@TEST_TIME@" time="0" name="AllTests"> | ||
<testsuite name="@TEST_NAME@" tests="1" failures="0" disabled="0" errors="0" time="0"> | ||
<testcase name="ign_script" status="run" time="0" classname="@TEST_NAME@" /> | ||
</testsuite> | ||
</testsuites> |