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 1185 - (download) (annotate)
Wed May 11 13:20:27 2011 UTC (8 years, 6 months ago) by jhr
File size: 1761 byte(s)
  added the ability to test a different version of the diderot compiler
#!/bin/ksh
#
# A script for running the Diderot regression tests.
#
# @configure_input@
#

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

# 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
	DIDEROTC=$1
      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