summaryrefslogtreecommitdiff
path: root/regress-driver
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2010-06-17 12:08:48 -0400
committerEric S. Raymond <esr@thyrsus.com>2010-06-17 12:08:48 -0400
commit91f0892c851e7c94a61510a34177a4b1be781f94 (patch)
tree3908d1c0a25a710807c0866e7b81458125cb3d32 /regress-driver
parentdf407cbf73c86540f99cc8e8f6a7bb25a4b3df45 (diff)
downloadgpsd-91f0892c851e7c94a61510a34177a4b1be781f94.tar.gz
Make the diff output from the regression driver a bit easier to read.
All regression tests pass.
Diffstat (limited to 'regress-driver')
-rwxr-xr-xregress-driver15
1 files changed, 10 insertions, 5 deletions
diff --git a/regress-driver b/regress-driver
index 5144393d..e571b108 100755
--- a/regress-driver
+++ b/regress-driver
@@ -77,21 +77,26 @@ case $mode in
echo "Testing the $testing..." >&2
errors=0; total=0; notfound=0;
for f in $*; do
- trap 'rm -f ${TMP}/test-$$.chk ${TMP}/test-whole-$$.chk ${TMP}/log-copy-$$.chk ${TMP}/diff-$$; exit $errors' EXIT HUP INT TERM
+ trap 'rm -f ${TMP}/test-$$.chk ${TMP}/testout-$$.chk ${TMP}/testin-$$.chk ${TMP}/diff-$$; exit $errors' EXIT HUP INT TERM
if [ -r $f.chk ]
then
case $testing in
daemon) gpsfake -s 38400 -1 -p $opts ${f} | ${GPSFILTER} ${ALTFILTER} >${TMP}/test-$$.chk ;;
clientlib) $GPSD_HOME/libgps -b <${f} >${TMP}/test-$$.chk ;;
esac
- sed -n <${f}.chk >${TMP}/log-copy-$$.chk ${ALTFILTER} -e 'p';
- sed -n <${TMP}/test-$$.chk >${TMP}/test-whole-$$.chk ${ALTFILTER} -e 'p';
- diff -ub ${TMP}/log-copy-$$.chk ${TMP}/test-whole-$$.chk >${TMP}/diff-$$;
+ if [ "${ALTFILTER}" ]
+ then
+ sed -n <${f}.chk >${TMP}/testin-$$.chk ${ALTFILTER} -e 'p';
+ sed -n <${TMP}/test-$$.chk >${TMP}/testout-$$.chk ${ALTFILTER} -e 'p';
+ diff -ub ${TMP}/testin-$$.chk ${TMP}/testout-$$.chk >${TMP}/diff-$$;
+ else
+ diff -ub ${f}.chk ${TMP}/test-$$.chk >${TMP}/diff-$$;
+ fi
if test -s ${TMP}/diff-$$ ; then
errors=`expr $errors + 1`;
cat ${TMP}/diff-$$
fi;
- rm -f ${TMP}/test-$$.chk ${TMP}/test-whole-$$.chk ${TMP}/log-copy-$$.chk ${TMP}/diff-$$
+ rm -f ${TMP}/test-$$.chk ${TMP}/testout-$$.chk ${TMP}/testin-$$.chk ${TMP}/diff-$$
else
echo "*** No check log $f.chk exists"
notfound=`expr $notfound + 1`;