mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
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.
25 lines
414 B
Bash
Executable File
25 lines
414 B
Bash
Executable File
#!/bin/sh
|
|
|
|
if [ $# -lt 2 ]; then
|
|
echo "$0: output-of-run destination-xml"
|
|
exit 1
|
|
fi
|
|
|
|
set -e
|
|
|
|
infile=$1
|
|
outfile=$2
|
|
owndir=`dirname $0`
|
|
ownname=`basename $0`
|
|
tmpfile=`mktemp --tmpdir $ownname.XXXXXXXXXX`
|
|
|
|
(
|
|
echo '<?xml version="1.0" encoding="UTF-8"?>';
|
|
echo '<tests>';
|
|
cat $infile;
|
|
echo '</tests>'
|
|
) > $tmpfile
|
|
|
|
xsltproc --encoding UTF-8 $owndir/run-xml-to-junit.xsl $tmpfile > $outfile
|
|
unlink $tmpfile
|