summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMorgan Deters <mdeters@gmail.com>2011-03-15 21:06:47 +0000
committerMorgan Deters <mdeters@gmail.com>2011-03-15 21:06:47 +0000
commit3041680aecaf8f264f6c56f4030dd908f7375cb8 (patch)
tree22c83a439131456b4519bb3a1f35e481d8f4b2ee /test
parentd7554865a91733a39dd658e2003ca072e8e2ed4b (diff)
small fixes for run_regression script to workaround bug in old mktemp, was causing a hang in bug220.smt2
Diffstat (limited to 'test')
-rwxr-xr-xtest/regress/run_regression34
1 files changed, 20 insertions, 14 deletions
diff --git a/test/regress/run_regression b/test/regress/run_regression
index f5c8adb15..7232fdae6 100755
--- a/test/regress/run_regression
+++ b/test/regress/run_regression
@@ -32,6 +32,18 @@ if ! [ -r "$benchmark" ]; then
error "\`$benchmark' doesn't exist or isn't readable" >&2
fi
+# gettemp() and its associated tempfiles[] array are intended to never
+# allow a temporary file to leak---the trap ensures that when this script
+# exits, whether via a regular exit or an -INT or other signal, the
+# temp files are deleted.
+declare -a tempfiles
+trap -- 'test ${#tempfiles[@]} -gt 0 && rm -f "${tempfiles[@]}"' EXIT
+function gettemp {
+ local temp="`mktemp -t "$2"`"
+ tempfiles[${#tempfiles[@]}]="$temp"
+ eval "$1"="$temp"
+}
+
tmpbenchmark=
if expr "$benchmark" : '.*\.smt$' &>/dev/null; then
if test -e "$benchmark.expect"; then
@@ -47,7 +59,10 @@ if expr "$benchmark" : '.*\.smt$' &>/dev/null; then
expected_error=`grep '^% EXPECT-ERROR: ' "$benchmark" | sed 's,^% EXPECT-ERROR: ,,'`
expected_exit_status=`grep -m 1 '^% EXIT: ' "$benchmark" | sed 's,^% EXIT: ,,'`
command_line=`grep '^% COMMAND-LINE: ' "$benchmark" | sed 's,^% COMMAND-LINE: ,,'`
- gettemp tmpbenchmark cvc4_benchmark.$$.XXXXXXXXXX.smt
+ # old mktemp from coreutils 7.x is broken, can't do XXXX in the middle
+ # this frustrates our auto-language-detection, so add explicit --lang
+ gettemp tmpbenchmark cvc4_benchmark.smt.$$.XXXXXXXXXX
+ command_line="${command_line:+ $command_line}--lang=smt"
grep -v '^% \(EXPECT\|EXPECT-ERROR\|EXIT\|COMMAND-LINE\): ' "$benchmark" >"$tmpbenchmark"
if [ -z "$expected_exit_status" ]; then
error "cannot determine expected exit status of \`$benchmark': please use \`% EXIT:' gesture"
@@ -78,7 +93,10 @@ elif expr "$benchmark" : '.*\.smt2$' &>/dev/null; then
expected_error=`grep '^% EXPECT-ERROR: ' "$benchmark" | sed 's,^% EXPECT-ERROR: ,,'`
expected_exit_status=`grep -m 1 '^% EXIT: ' "$benchmark" | sed 's,^% EXIT: ,,'`
command_line=`grep '^% COMMAND-LINE: ' "$benchmark" | sed 's,^% COMMAND-LINE: ,,'`
- gettemp tmpbenchmark cvc4_benchmark.$$.XXXXXXXXXX.smt2
+ # old mktemp from coreutils 7.x is broken, can't do XXXX in the middle
+ # this frustrates our auto-language-detection, so add explicit --lang
+ gettemp tmpbenchmark cvc4_benchmark.smt2.$$.XXXXXXXXXX
+ command_line="${command_line:+ $command_line}--lang=smt2"
grep -v '^% \(EXPECT\|EXPECT-ERROR\|EXIT\|COMMAND-LINE\): ' "$benchmark" >"$tmpbenchmark"
if [ -z "$expected_exit_status" ]; then
error "cannot determine expected exit status of \`$benchmark': please use \`% EXIT:' gesture"
@@ -111,18 +129,6 @@ else
error "benchmark \`$benchmark' must be *.cvc or *.smt or *.smt2"
fi
-# gettemp() and its associated tempfiles[] array are intended to never
-# allow a temporary file to leak---the trap ensures that when this script
-# exits, whether via a regular exit or an -INT or other signal, the
-# temp files are deleted.
-declare -ax tempfiles
-trap -- 'test ${#tempfiles[@]} -gt 0 && rm -vf "${tempfiles[@]}"' EXIT
-function gettemp {
- temp="`mktemp -t "$2"`"
- tempfiles[${#tempfiles[@]}]="$temp"
- eval "$1"="$temp"
-}
-
gettemp expoutfile cvc4_expect_stdout.$$.XXXXXXXXXX
gettemp experrfile cvc4_expect_stderr.$$.XXXXXXXXXX
gettemp outfile cvc4_stdout.$$.XXXXXXXXXX
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback