]> granicus.if.org Git - flex/commitdiff
make tests/testwrapper.sh more verbose; find input in srcdir
authorWill Estes <westes575@gmail.com>
Sun, 1 Jun 2014 19:09:29 +0000 (15:09 -0400)
committerWill Estes <westes575@gmail.com>
Wed, 12 Nov 2014 10:14:26 +0000 (05:14 -0500)
Since output is redirected by the automake parallel test suite driver,
turn on both -v and -x in bash for the testwrapper.sh shell
script. This helps a ton in debugging problems with the test harness
itself.

In general, the input files are in automake's srcdir and the name of
the test includes the relative path to it (even though that's supposed
to be ./). Therefore, pass srcdir in AM_LOG_FLAGS and prepend that to
the test name as part of constructing the input file's name.

tests/Makefile.am
tests/testwrapper.sh

index 0f9ffd98b6eb8ecf06a7d7b633717212b4d5070b..042a042a42443f6a7d75c216e5770fb5ad136b67 100644 (file)
@@ -25,6 +25,7 @@ EXTRA_DIST = \
 TESTS = $(check_PROGRAMS)
 
 LOG_COMPILER = $(srcdir)/testwrapper.sh
+AM_LOG_FLAGS = $(srcdir)
 
 check_PROGRAMS = \
        alloc-extra \
index f35f8ed6ac31e198475aa1215f992d7cf84c4725..7194e6de42737494671d2416cdffafeb054ff8c9 100755 (executable)
@@ -1,11 +1,11 @@
-#!/bin/bash
+#!/bin/bash -vx
 
 # testwrapper.sh: run a flex test, typically called by a Makefile
 
 # Each test will exercise some feature or aspect of flex. Run the test with any input it may need.
 
-INPUTFILE=/dev/null
-
-TESTNAME="$1"
-
+SRCDIR="$1"
+TESTNAME="$2"
+INPUTNAME=`basename $TESTNAME`.txt
 
+$TESTNAME < $SRCDIR/$INPUTNAME