]> git.ipfire.org Git - thirdparty/pdns.git/blob - regression-tests/toxml
rec: ensure correct service user on debian
[thirdparty/pdns.git] / regression-tests / toxml
1 #!/bin/sh
2
3 getstdout ()
4 {
5 if [ -e "${testsdir}/$t/stdout" ]
6 then
7 echo ' <system-out>'
8 cat ${testsdir}/$t/stdout | sed -e 's/&/\&amp;/g' -e 's/"/\&quot;/g' -e "s/'/\\&apos;/g" -e 's/</\&lt;/g' -e 's/>/\&gt;/g'
9 echo ' </system-out>'
10 fi
11 }
12
13 [ -z "$context" ] && context="global"
14 exec > testresults-${context}.xml
15 echo '<?xml version="1.0"?>'
16 NUMTESTS=$(cat failed_tests passed_tests | wc -l)
17 NUMFAILED=$(cat failed_tests | wc -l)
18 echo '<testsuite tests="'$NUMTESTS'" failures="'$NUMFAILED'" errors="'$NUMFAILED'" name="'$context'">'
19 for t in $(cat failed_tests)
20 do
21 echo ' <testcase name="'$t'" classname="'$context'" time="0">'
22 echo ' <error type="error" message="test failed">'
23 [ -e ${testsdir}/$t/diff ] && cat ${testsdir}/$t/diff | sed -e 's/&/\&amp;/g' -e 's/"/\&quot;/g' -e "s/'/\\&apos;/g" -e 's/</\&lt;/g' -e 's/>/\&gt;/g'
24 echo ' </error>'
25 getstdout
26 echo ' </testcase>'
27 done
28 for t in $(cat passed_tests)
29 do
30 echo ' <testcase name="'$t'" classname="'$context'" time="0">'
31 getstdout
32 echo ' </testcase>'
33 done
34 echo '</testsuite>'