Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /trunk/rtest/scripts/run_sh.in
ViewVC logotype

View of /trunk/rtest/scripts/run_sh.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1199 - (download) (annotate)
Thu May 12 12:40:29 2011 UTC (8 years, 2 months ago) by jhr
File size: 1816 byte(s)
  tweaking the regression-test script
#!/bin/ksh
#
# A script for running the Diderot regression tests.
#
# @configure_input@
#

# set up the path so that we can find unu
#
PATH=/bin:/usr/bin:@TEEM_DIR@/bin

# 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=""
while [ $# -ne 0 ] ; do
  case $1 in
    -*) DIDEROTC_FLAGS="$DIDEROTC_FLAGS $1" ;;
    *) if [ -x $1 ] ; then
	case $1 in
	  /*) DIDEROTC=$1 ;; # absolute path
	  *) DIDEROTC=$HERE/$1 ;; #relative path
	esac
      else
	echo "unrecognized argument"
	exit 1
      fi
    ;;
  esac
  shift
done

# 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" > $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" >> $LOG
    ./$t 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.o $t $t.log mip.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"

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0