From 91f0892c851e7c94a61510a34177a4b1be781f94 Mon Sep 17 00:00:00 2001 From: "Eric S. Raymond" Date: Thu, 17 Jun 2010 12:08:48 -0400 Subject: Make the diff output from the regression driver a bit easier to read. All regression tests pass. --- regress-driver | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'regress-driver') 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`; -- cgit v1.2.1