]>
Commit | Line | Data |
---|---|---|
5828314f | 1 | #!/bin/sh |
dfddcdaf PD |
2 | |
3 | getstdout () | |
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/&/\&/g' -e 's/"/\"/g' -e "s/'/\\'/g" -e 's/</\</g' -e 's/>/\>/g' |
dfddcdaf PD |
9 | echo ' </system-out>' |
10 | fi | |
11 | } | |
12 | ||
0be49616 PD |
13 | [ -z "$context" ] && context="global" |
14 | exec > testresults-${context}.xml | |
5828314f PD |
15 | echo '<?xml version="1.0"?>' |
16 | NUMTESTS=$(cat failed_tests passed_tests | wc -l) | |
17 | NUMFAILED=$(cat failed_tests | wc -l) | |
0be49616 | 18 | echo '<testsuite tests="'$NUMTESTS'" failures="'$NUMFAILED'" errors="'$NUMFAILED'" name="'$context'">' |
5828314f PD |
19 | for t in $(cat failed_tests) |
20 | do | |
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/&/\&/g' -e 's/"/\"/g' -e "s/'/\\'/g" -e 's/</\</g' -e 's/>/\>/g' |
737c5116 | 24 | echo ' </error>' |
dfddcdaf | 25 | getstdout |
5828314f PD |
26 | echo ' </testcase>' |
27 | done | |
7dbdd1e7 PD |
28 | for t in $(cat passed_tests) |
29 | do | |
dfddcdaf PD |
30 | echo ' <testcase name="'$t'" classname="'$context'" time="0">' |
31 | getstdout | |
32 | echo ' </testcase>' | |
7dbdd1e7 | 33 | done |
5828314f | 34 | echo '</testsuite>' |