## -*- sh -*- ## ## timeval_test - Testing class TimeVal ## ## $Id: timeval.test,v 1.2 2005/01/07 02:28:57 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 timeval_test Test = 1) Testing constructors ...ok 2) Testing conversion to/from struct timeval ...ok 3) Testing assignment opt ...ok 4) Testing +/- opts ...ok 5) Testing logical opts ...ok 6) Testing default formatting ...ok 7) Testing user-specified formatting ...ok 8) Testing formatting functions ...ok 9) Testing default initialization ...ok Test passed EOF # Unexpected output cat <<\EOF >errok EOF # You can specify command-line arguments here RUNTEST="${top_builddir}/tests/timeval_test" # Run test $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-]*timeval_test[.ex]*:,timeval_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