diff options
author | Will Estes <westes575@gmail.com> | 2014-06-16 16:11:14 -0400 |
---|---|---|
committer | Will Estes <westes575@gmail.com> | 2014-11-12 05:14:27 -0500 |
commit | 99e4880ccdb0c4691186622de066f2bc1f2c1074 (patch) | |
tree | 20a541edcb0e014afc00a63a620355d79204a2eb /tests/testwrapper.sh | |
parent | 98d9a5af2b7e4895253e8854407b5455373e3b8a (diff) |
Refactor reject test for new test suite layout.
Split out reject test into its constituant tests. Add .reject tests
and .table tests for automake test log generation. Rewrite
testwrapper.sh to handle running with a tables file and specifying
optional input using command line options rather than positional
parameters.
Diffstat (limited to 'tests/testwrapper.sh')
-rwxr-xr-x | tests/testwrapper.sh | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/tests/testwrapper.sh b/tests/testwrapper.sh index f4ecff1..dd8c077 100755 --- a/tests/testwrapper.sh +++ b/tests/testwrapper.sh @@ -4,12 +4,23 @@ # Each test will exercise some feature or aspect of flex. Run the test with any input it may need. -SRCDIR="$1" -TESTNAME="$2" -INPUTNAME=`basename $TESTNAME`.txt +INPUT_DIRECTORY="" +INPUT_NAME="" -if [ -f $SRCDIR/$INPUTNAME ] ; then - $TESTNAME < $SRCDIR/$INPUTNAME +while getopts :d:i:t OPTION ; do + case $OPTION in + d) INPUT_DIRECTORY=$OPTARG ;; + i) INPUTNAME="$OPTARG" ;; + t) USE_TABLES=1 ;; + esac + done + +TESTNAME="${!$OPTIND}" + +INPUTNAME=${INPUT_NAME:-`basename $TESTNAME`.txt} + +if [ -f $INPUT_DIRECTORY/$INPUT_NAME ] ; then + $TESTNAME ${USE_TABLES:+${INPUT_DIRECTORY}${TESTNAME}} < $INPUT_DIRECTORY/$INPUT_NAME else $TESTNAME fi |