]> git.ipfire.org Git - thirdparty/pdns.git/blame - regression-tests/toxml
Fix typo in basic-database guide
[thirdparty/pdns.git] / regression-tests / toxml
CommitLineData
5828314f 1#!/bin/sh
dfddcdaf
PD
2
3getstdout ()
4{
53f66707 5 if [ -e "${testsdir}/$t/stdout" ]
dfddcdaf
PD
6 then
7 echo ' <system-out>'
53f66707 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'
dfddcdaf
PD
9 echo ' </system-out>'
10 fi
11}
12
0be49616
PD
13[ -z "$context" ] && context="global"
14exec > testresults-${context}.xml
5828314f
PD
15echo '<?xml version="1.0"?>'
16NUMTESTS=$(cat failed_tests passed_tests | wc -l)
17NUMFAILED=$(cat failed_tests | wc -l)
0be49616 18echo '<testsuite tests="'$NUMTESTS'" failures="'$NUMFAILED'" errors="'$NUMFAILED'" name="'$context'">'
5828314f
PD
19for t in $(cat failed_tests)
20do
0be49616 21 echo ' <testcase name="'$t'" classname="'$context'" time="0">'
737c5116 22 echo ' <error type="error" message="test failed">'
53f66707 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'
737c5116 24 echo ' </error>'
dfddcdaf 25 getstdout
5828314f
PD
26 echo ' </testcase>'
27done
7dbdd1e7
PD
28for t in $(cat passed_tests)
29do
dfddcdaf
PD
30 echo ' <testcase name="'$t'" classname="'$context'" time="0">'
31 getstdout
32 echo ' </testcase>'
7dbdd1e7 33done
5828314f 34echo '</testsuite>'