diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2007-12-13 05:25:45 +0000 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2007-12-13 05:25:45 +0000 |
commit | fd49fe3820023dde36daeb2fe240ad6f29324bb7 (patch) | |
tree | f3c250c9d5157f0d990d9db05357e1022d17cc4f /regress-driver | |
parent | 5e9f527f77b6f09a59b64d0d667274f4aefb6881 (diff) | |
download | gpsd-fd49fe3820023dde36daeb2fe240ad6f29324bb7.tar.gz |
Cope gracefully if a regression test is missing its check file.
Diffstat (limited to 'regress-driver')
-rwxr-xr-x | regress-driver | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/regress-driver b/regress-driver index 16defd72..7ce6131e 100755 --- a/regress-driver +++ b/regress-driver @@ -12,20 +12,26 @@ case $1 in shift echo "Testing the daemon..." mkdir -p test - errors=0; total=0; + errors=0; total=0; notfound=0; for f in $*; do dir=`dirname $f` - gpsfake -s 38400 -1 -b -p ${f} | grep -v "^GPSD,X" >$dir/test.chk; - if diff -ub ${f}.chk $dir/test.chk; then :; else - errors=`expr $errors + 1`; - fi; - total=`expr $total + 1`; + if [ -r $f.chk ] + then + gpsfake -s 38400 -1 -b -p ${f} | grep -v "^GPSD,X" >$dir/test.chk; + if diff -ub ${f}.chk $dir/test.chk; then :; else + errors=`expr $errors + 1`; + fi; + else + echo "*** No check log $f.chk exists" + notfound=`expr $notfound + 1`; + fi + total=`expr $total + 1`; done; rm $dir/test.chk; if test $errors -gt 0; then - echo "Regression test FAILED: $errors errors in $total tests total."; + echo "Regression test FAILED: $errors errors in $total tests total ($notfound not found)."; exit 1; else - echo "Regression test successful: no errors in $total tests."; + echo "Regression test successful: no errors in $total tests ($notfound not found)."; exit 0; fi ;; |