Skip to content

Commit

Permalink
show diffs on summary output
Browse files Browse the repository at this point in the history
  • Loading branch information
tbonfort committed Sep 12, 2012
1 parent 048a236 commit 25460b6
Showing 1 changed file with 39 additions and 9 deletions.
48 changes: 39 additions & 9 deletions runtests.sh
Expand Up @@ -2,19 +2,49 @@

ret=0

#for testcase in misc gdal renderers wxs; do
for testcase in gdal ; do
logfile="/tmp/logfile-$testcase.log"
exec > >(tee $logfile)
exec 2>&1
tests=( misc gdal renderers wxs )
tests=( wxs )

for testcase in "${tests[@]}" ; do
cd msautotest/$testcase
./run_test.py class16_range.map
./run_test.py

grep -q "^0 tests failed" $logfile
RETVAL=$?
[ $RETVAL -ne 0 ] && ret=1
cd ../..
done

#tests failed, provide a summary
echo ""
echo " Test run summary "
echo "################################"
for testcase in "${tests[@]}"; do
cd msautotest/$testcase
echo ""
if [ ! -d result ]; then
#"result" directory does not exist, all tests passed
cd ../..
echo "$testcase: PASS"
continue
fi
cd result
#leftover .aux.xml files are valid for some gdal tests
failedtests=`find . ! -name '*.aux.xml' -type f -printf "%f\n" `
if [ -z "$failedtests" ]; then
cd ../../..
echo "$testcase: PASS"
continue
fi
#we have some failing tests
ret=1
echo "!!!!! $testcase: FAIL !!!!!"
echo "failing tests:"
for failedtest in $failedtests; do
echo $failedtest
#for gml and xml files, print a diff
if echo "$failedtest" | egrep -q "(xml|gml)$"; then
diff -u "../expected/$failedtest" "$failedtest"
fi
done
cd ../../..
done

exit $ret

0 comments on commit 25460b6

Please sign in to comment.