#!/bin/ksh # # A script for running the Diderot regression tests. # # usage: # scripts/run.sh [diderotc] [diderotc-flags] [-- runtime-flags] # # @configure_input@ # # set up the path so that we can find unu # PATH=/bin:/usr/bin:@TEEM_DIR@/bin function usage { echo "usage:" echo " scripts/run.sh [diderotc] [diderotc-flags] [-- runtime-flags]" exit $1 } # this script should be run from the rtest directory # HERE=$(pwd) if [ ! -d $HERE/tests ] ; then echo "run script from rtest directory" exit 1 fi # process command-line arguments # DIDEROTC="@DIDEROT_BINDIR@/diderotc" DIDEROTC_FLAGS="" RUNTIME_FLAGS="" if [ $# -ne 0 ] ; then # first we check for the diderotc command case $1 in -*) ;; # no diderot command /*) DIDEROTC=$1; shift ;; # absolute path *) DIDEROTC=$HERE/$1; shift ;; #relative path esac # get diderotc flags while [ $# -ne 0 ] ; do case $1 in --) shift; break ;; # switch modes -*) DIDEROTC_FLAGS="$DIDEROTC_FLAGS $1" ;; *) echo "unrecognized argument" usage 1 ;; esac shift done # get runtime flags while [ $# -ne 0 ] ; do case $1 in -*) RUNTIME_FLAGS="$RUNTIME_FLAGS $1" ;; *) echo "unrecognized argument" usage 1 ;; esac shift done fi # # check that the diderotc path is valid # if [ ! -x $DIDEROTC ] ; then echo "$DIDEROTC is not executable or does not exist" exit 1 fi # get a list of all of the tests (one per directory) # TESTS=$(cd tests; ls) DATE=$( date +"%F-%H-%M-%S" ) LOG=$HERE/log.$DATE REPORT=$HERE/report.$DATE echo "testing $DIDEROTC $DIDEROTC_FLAGS" > $REPORT for t in $TESTS ; do ( cd tests/$t; echo "********** $t **********" > $LOG echo -n "checking $t ... " >> $REPORT echo "$DIDEROTC $DIDEROTC_FLAGS $t.diderot" >> $LOG $DIDEROTC $DIDEROTC_FLAGS $t.diderot 2>> $LOG 1>> $LOG if [ "$?" -eq "0" ] ; then echo -n "compile succeeded ... " >> $REPORT echo "./$t $RUNTIME_FLAGS" >> $LOG ./$t $RUNTIME_FLAGS 2>> $LOG 1>> $LOG if [ "$?" -eq "0" ] ; then echo -n "execution succeeded ... " >> $REPORT result=$(./assess.sh) if (($result < 1.0)) ; then echo "result is good ($result)" >> $REPORT echo "ok" >> $LOG echo "$t is okay" rm -f $t.c $t.cl $t.o $t $t.log $t.txt else echo "result is bad ($result)" >> $REPORT echo "$t failed" fi else echo "execution failed" >> $REPORT echo "$t failed" fi else echo "compile failed" >> $REPORT echo "$t failed" fi echo "**********" >> $LOG ) done echo "complete report at $REPORT"
Click to toggle
does not end with </html> tag
does not end with </body> tag
The output has ended thus: EPORT echo "$t failed" fi echo "**********" >> $LOG ) done echo "complete report at $REPORT"