From: Will Estes Date: Sun, 1 Jun 2014 19:09:29 +0000 (-0400) Subject: make tests/testwrapper.sh more verbose; find input in srcdir X-Git-Tag: v2.6.0~89 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fddc982e9f447f22248397f9e94e76c93e1d723f;p=flex make tests/testwrapper.sh more verbose; find input in srcdir 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. --- diff --git a/tests/Makefile.am b/tests/Makefile.am index 0f9ffd9..042a042 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -25,6 +25,7 @@ EXTRA_DIST = \ TESTS = $(check_PROGRAMS) LOG_COMPILER = $(srcdir)/testwrapper.sh +AM_LOG_FLAGS = $(srcdir) check_PROGRAMS = \ alloc-extra \ diff --git a/tests/testwrapper.sh b/tests/testwrapper.sh index f35f8ed..7194e6d 100755 --- a/tests/testwrapper.sh +++ b/tests/testwrapper.sh @@ -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