summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWill Estes <westes575@gmail.com>2014-07-18 21:16:11 -0400
committerWill Estes <westes575@gmail.com>2014-11-12 05:14:28 -0500
commitf4ec87b6d926cfe635b480dbeec71b3b489dbb02 (patch)
tree3fade66a004ff0f861fa2bd3b2846bc0febd27ea
parent976cc15cf72c08521e4b575cad6900c109ca71b2 (diff)
use unofficial bash strict mode and cleanups in supporting bash scripts
-rwxr-xr-xtests/tableopts.sh7
-rwxr-xr-xtests/testwrapper.sh4
2 files changed, 9 insertions, 2 deletions
diff --git a/tests/tableopts.sh b/tests/tableopts.sh
index f009b7d..63a36d3 100755
--- a/tests/tableopts.sh
+++ b/tests/tableopts.sh
@@ -1,4 +1,6 @@
-#!/bin/sh
+#!/bin/bash
+set -euo pipefail
+IFS=$'\n\t'
# This script is present to generate the automake _SOURCES variables
# for the tableopts_* tests. It also generates the linking rules for
@@ -6,6 +8,9 @@
# would be natural to use. Output is written to standard output for
# inclusion in a Makefile.am, typically by redirecting the output and then an automake include directive.
+TABLEOPTS_TESTS=""
+tableopts_tables=""
+
for kind in opt ser ver ; do
for threading in nr r ; do
for opt in -Ca -Ce -Cf -CF -Cm -Cem -Cae -Caef -CaeF -Cam -Caem ; do
diff --git a/tests/testwrapper.sh b/tests/testwrapper.sh
index 014ee0a..30127b5 100755
--- a/tests/testwrapper.sh
+++ b/tests/testwrapper.sh
@@ -1,4 +1,5 @@
#!/bin/bash -vx
+set -euo pipefail
# testwrapper.sh: run a flex test, typically called by a Makefile
@@ -8,6 +9,7 @@ INPUT_DIRECTORY=""
INPUT_NAME=""
INPUT_COUNT=0
USE_REDIRECT=0
+DO_COMPARISON=0
while getopts :d:i:rt1 OPTION ; do
case $OPTION in
@@ -30,7 +32,7 @@ TESTNAME="${!OPTIND}"
INPUT_NAME=${INPUT_NAME:-`basename $TESTNAME`.txt}
-if [ "$DO_COMPARISON" == "1" ] ; then
+if [ "$DO_COMPARISON" -eq "1" ] ; then
test `$TESTNAME 1 < $INPUT_DIRECTORY/$INPUT_NAME` -eq `$TESTNAME < $INPUT_DIRECTORY/$INPUT_NAME`
exit $?
fi