## -*- sh -*- ## bufio.test - Testing buffered I/O ## ## $Id: bufio.test,v 1.3 2005/08/19 03:18:28 vlg Exp $ # Common definitions self="[bufio] " 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 CONNECTION ESTABLISHED T1: OK T2: OK T3: OK T4: OK EOF # Unexpected output cat <<\EOF >errok EOF # Run test RUNTEST="${top_builddir}/tests/bufio_testc --build-dir=${top_builddir}/tests --port=$ASSAPORT --log-file=bufioC.log" $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-]*bufio_testc[.ex]*:,bufio_testc;," 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