## -*- sh -*- ## ## pipe.test - Testing class Pipe ## ## $Id: pipe.test,v 1.3 2005/03/14 03:45:46 vlg Exp $ # Common definitions if test -z "$srcdir" ; then srcdir=`echo "$0" | sed 's,[^/]*$,,'` test "$srcdir" = "$0" && srdir=. test -z "$srcdir" && srcdir=. test "${VERBOSE+set}" != set && VERBOSE=1 fi . $srcdir/defs # this is the output we should expect to see cat <<\EOF >ok = Running pipe_test Test = Passed test 1 Passed test 2 EOF # Unexpected output cat <<\EOF >errok EOF # Make sure there is no leftovers hanging aroud from # previous runs if test -f ~/.smoker1.pid ; then kill `cat ~/.smoker1.pid` ; fi if test -f ~/.smoker2.pid ; then kill `cat ~/.smoker2.pid` ; fi # You can specify command-line arguments here RUNTEST="${top_builddir}/tests/pipe_test --build-dir=${top_builddir}/tests" $RUNTEST 2> err | tee -i out >&2 # Test against expected output if ${CMP} -s out ok; then : else echo "ok:" >&2 cat ok >&2 exit 1 fi # Mungle error output to remove leading directories, 'lt-' or # trailing '.exe' sed -e "s,^[^:]*[lt-]*pipe_test[.ex]*:,pipe_test;," err >sederr && mv sederr err # Show stderr if doesn't match expected output if VERBOSE=1 if "$CMP" -s err errok; then : else echo "err:" >&2 cat err >&2 echo "errok:" >&2 cat errok >&2 exit 1 fi