mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
tests: provide a simple way to extract the tests data from run
If the RUN_OUTPUT_FILE environment variable is set, "run" will output to the file indicated by that snippets of XML with the results and outputs of the tests run. Together with the run-xml-to-junit.sh (and its associated run-xml-to-junit.xsl style sheet) it is possible to convert that output file to a jUnit-like XML file, which could be used in CI systems.
This commit is contained in:
8
run.in
8
run.in
@@ -260,5 +260,13 @@ else
|
||||
cat $tmpout
|
||||
echo "$b/run: command failed with exit code $fail"
|
||||
fi
|
||||
if [ -n "$RUN_OUTPUT_FILE" ]; then
|
||||
testname=`echo "$1" | sed -e 's,^./,,g'`
|
||||
echo "<test rescode=\"$fail\" name=\"$testname\" time=\"$(($end_t - $start_t))\">" >> $RUN_OUTPUT_FILE
|
||||
echo "<![CDATA[" >> $RUN_OUTPUT_FILE
|
||||
cat $tmpout >> $RUN_OUTPUT_FILE
|
||||
echo "]]>" >> $RUN_OUTPUT_FILE
|
||||
echo "</test>" >> $RUN_OUTPUT_FILE
|
||||
fi
|
||||
rm -f $tmpout
|
||||
exit $fail
|
||||
|
||||
Reference in New Issue
Block a user