summaryrefslogtreecommitdiff
path: root/tests/testwrapper-direct.sh
diff options
context:
space:
mode:
authorWill Estes <westes575@gmail.com>2016-05-20 17:25:10 -0400
committerWill Estes <westes575@gmail.com>2016-05-20 17:31:27 -0400
commit7878f90988bb794b975759495dcb50822f61886c (patch)
treec8f233210a098eb91fe82ae25207ee0e35e5ecf6 /tests/testwrapper-direct.sh
parent1b7a7165f3f84396c12d0b332b0448d691cf88e5 (diff)
test: run direct tests from srcdir
Diffstat (limited to 'tests/testwrapper-direct.sh')
-rwxr-xr-xtests/testwrapper-direct.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/testwrapper-direct.sh b/tests/testwrapper-direct.sh
new file mode 100755
index 0000000..e0e7fd9
--- /dev/null
+++ b/tests/testwrapper-direct.sh
@@ -0,0 +1,17 @@
+#!/bin/bash -vx
+set -euo pipefail
+
+# testwrapper-direct.sh: run some specialized flex tests that care where they're run from.
+
+while getopts :b:s: OPTION ; do
+ case $OPTION in
+ b) BINARY_DIR=$OPTARG ;;
+ s) SOURCE_DIR=$OPTARG ;;
+ esac
+ done
+
+TESTNAME="${!OPTIND}"
+
+INPUT_NAME=`basename ${TESTNAME%.exe}`.txt
+
+cd ${SOURCE_DIR} && ${BINARY_DIR}/${TESTNAME} ${INPUT_NAME}