]> granicus.if.org Git - flex/commitdiff
Check if test input file exists.
authorWill Estes <westes575@gmail.com>
Thu, 12 Jun 2014 22:26:15 +0000 (18:26 -0400)
committerWill Estes <westes575@gmail.com>
Wed, 12 Nov 2014 10:14:27 +0000 (05:14 -0500)
Not all tests have input files, so check if one exists and run the
test program accordingly.

tests/testwrapper.sh

index 7194e6de42737494671d2416cdffafeb054ff8c9..f4ecff1fc8a5071115cc00785078013bef236fdf 100755 (executable)
@@ -8,4 +8,8 @@ SRCDIR="$1"
 TESTNAME="$2"
 INPUTNAME=`basename $TESTNAME`.txt
 
-$TESTNAME < $SRCDIR/$INPUTNAME
+if [ -f $SRCDIR/$INPUTNAME ] ; then
+    $TESTNAME < $SRCDIR/$INPUTNAME
+else
+    $TESTNAME
+fi