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

SCM Repository

[diderot] View of /branches/vis15/src/tests/rtest/scripts/run-one_sh.in
ViewVC logotype

View of /branches/vis15/src/tests/rtest/scripts/run-one_sh.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4102 - (download) (annotate)
Wed Jun 29 22:03:51 2016 UTC (3 years ago) by jhr
File size: 2152 byte(s)
adding regression tests
#!/bin/ksh
#
# A script for running a single Diderot regression test
#
# usage:
#	scripts/run-one.sh test [diderotc] [flags]
#
# @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

# get the name of the test to run
#
if (( $# >= 1 )) ; then
  RTEST=$1
  shift
  if [ ! -d tests/$RTEST ] ; then
    echo "$RTEST is not a valid regression-test name"
    exit 1
  fi
else
  echo "usage: scripts/run-one.sh test [diderotc] [flags]"
  exit 1
fi

# process the rest of the command-line arguments
#
DIDEROTC="@DIDEROT_BINDIR@/diderotc"
DIDEROTC_FLAGS="--exec --check-all"
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

DATE=$( date +"%F-%H-%M-%S" )
LOG=$HERE/log-$RTEST.$DATE
REPORT=$HERE/report-$RTEST.$DATE

echo "testing $DIDEROTC" > $REPORT
( cd tests/$RTEST;
  echo "********** $RTEST **********" >> $LOG
  echo -n "checking $RTEST ... " >> $REPORT
  echo "$DIDEROTC $DIDEROTC_FLAGS $RTEST.diderot" >> $LOG
  $DIDEROTC $DIDEROTC_FLAGS $RTEST.diderot 2>> $LOG 1>> $LOG
  if [ "$?" -eq "0" ] ; then
    echo -n "compile succeeded ... " >> $REPORT
    echo "./$RTEST" >> $LOG
    ./$RTEST 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 "$RTEST is okay"
	rm -f $RTEST.c $RTEST.cl $RTEST.o $RTEST $RTEST.log $RTEST.txt
      else
	echo "result is bad ($result)" >> $REPORT
	echo "$RTEST failed"
      fi
    else
      echo "execution failed" >> $REPORT
      echo "$RTEST failed"
    fi
  else
    echo "compile failed" >> $REPORT
    echo "$RTEST failed"
  fi
  echo "**********" >> $LOG
)
echo "complete report at $REPORT"

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