#!/bin/sh # # @(#)runtests.wrk 1.9 2003/12/30 Connectathon Testsuite # 1.4 Lachman ONC Test Suite source # # This script is intended to be invoked from 'runtests' # Don't run it manually case x$1 in xFROM_RUNTESTS) ;; *) echo "$0 must be run from 'runtests' - Don't run manually" exit 1 ;; esac errexit='cat $FILE; exit 1' TIME=time # if the default time command doesn't return the right format, # you may have to use the following lines case `uname` in [lL]inux*) TIME=/usr/bin/time ;; *) TIME=/bin/time ;; esac if [ ! -f $TIME ] then TIME=/usr/bin/time if [ ! -f $TIME ] then echo "Where is the time command?" exit 1 fi fi chmod 777 large4.sh mkdummy rmdummy umask 0 # Newer compilers tend to produce warning messages for the source code # that is used for the general tests. This confuses "stat". There # are a couple ways we could fix this (e.g., make "stat" ignore # compiler warnings). But since the general tests as a whole probably # should be replaced by something that is less Unix-centric, we'll # just hack around the problem by supressing compiler warnings. CFLAGS="$CFLAGS -w" export CFLAGS echo "" echo "Small Compile" rm -f smcomp.time FILE=smcomp.time $TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit $TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit $TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit $TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit $TIME $CC $CFLAGS -o stat stat.c -lm 2>> smcomp.time || eval $errexit ls smcomp.time ./stat smcomp.time echo "" echo "Tbl" rm -f tbl.time $TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time $TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time $TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time $TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time $TIME tbl nroff.in > nroff.tbl 2>> tbl.time || cat tbl.time # Filter excessive noise from GNU tbl. Should be harmless for other # versions of tbl. egrep -v '^tbl:.*$' tbl.new mv -f tbl.new tbl.time ./stat tbl.time echo "" echo "Nroff" rm -f nroff.time $TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time $TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time $TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time $TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time $TIME nroff < nroff.tbl > nroff.out 2>> nroff.time || cat nroff.time rm nroff.out nroff.tbl ./stat nroff.time echo "" echo "Large Compile" rm -f lrgcomp.time FILE=lrgcomp.time $TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit $TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit $TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit $TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit $TIME $CC $CFLAGS -o large large.c 2>> lrgcomp.time || eval $errexit rm large ./stat lrgcomp.time echo "" echo "Four simultaneous large compiles" rm -f 4lrg.time FILE=4lrg.time $TIME ./large4.sh 2>> 4lrg.time || eval $errexit $TIME ./large4.sh 2>> 4lrg.time || eval $errexit $TIME ./large4.sh 2>> 4lrg.time || eval $errexit $TIME ./large4.sh 2>> 4lrg.time || eval $errexit $TIME ./large4.sh 2>> 4lrg.time || eval $errexit ./stat 4lrg.time echo "" echo "Makefile" mkdummy rm -f makefile.time FILE=makefile.time $TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit $TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit $TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit $TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit $TIME make -e -f makefile.tst > /dev/null 2>> makefile.time || eval $errexit rmdummy # Remove warnings (e.g., due to clock skew) that might confuse "stat". grep -iv warning: makefile.time | grep -v 'make: ' > makefile.time2 mv makefile.time2 makefile.time ./stat makefile.time echo "" echo "General tests complete" exit 0