Commit fff33a1b by Edward Thomson

ci: write test result XML

Add the clar flags to produce JUnit-style XML output before invocation.
parent 943181c2
...@@ -37,11 +37,14 @@ die() { ...@@ -37,11 +37,14 @@ die() {
exit $1 exit $1
} }
# Ask ctest what it would run if we were to invoke it directly. This lets us manage the # Ask ctest what it would run if we were to invoke it directly. This lets
# test configuration in a single place (tests/CMakeLists.txt) instead of running clar # us manage the test configuration in a single place (tests/CMakeLists.txt)
# here as well. But it allows us to wrap our test harness with a leak checker like valgrind. # instead of running clar here as well. But it allows us to wrap our test
# harness with a leak checker like valgrind. Append the option to write
# JUnit-style XML files.
run_test() { run_test() {
TEST_CMD=$(ctest -N -V -R "^${1}$" | sed -n 's/^[0-9]*: Test command: //p') TEST_CMD=$(ctest -N -V -R "^${1}$" | sed -n 's/^[0-9]*: Test command: //p')
TEST_CMD="${TEST_CMD} -r${BUILD_DIR}/results_${1}.xml"
if [ "$LEAK_CHECK" = "valgrind" ]; then if [ "$LEAK_CHECK" = "valgrind" ]; then
RUNNER="$VALGRIND $TEST_CMD" RUNNER="$VALGRIND $TEST_CMD"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment