3 # TestRunner.sh - This script is used to run arbitrary unit tests. Unit
4 # tests must contain the command used to run them in the input file, starting
5 # immediately after a "RUN:" string.
7 # This runner recognizes and replaces the following strings in the command:
9 # %s - Replaced with the input name of the program, or the program to
10 # execute, as appropriate.
16 OUTPUT=Output/$FILENAME.out
19 # If more than one parameter is passed in, there must be three parameters:
20 # The filename to read from (already processed), the command used to execute,
21 # and the file to output to.
30 grep 'RUN:' $FILENAME | sed "s|^.*RUN:\(.*\)$|\1|g;s|%s|$SUBST|g" > $SCRIPT
33 /bin/sh $SCRIPT > $OUTPUT 2>&1 || (
34 echo "******************** TEST '$TESTNAME' FAILED! ********************"
40 echo "******************** TEST '$TESTNAME' FAILED! ********************"