summaryrefslogtreecommitdiff
path: root/test/regress/run_regression
diff options
context:
space:
mode:
authorTim King <taking@google.com>2017-01-10 17:51:14 -0800
committerTim King <taking@google.com>2017-01-10 18:21:15 -0800
commit1e7807069e07a710bafa83fc7412c3ac164249b8 (patch)
tree3301a132c17645a33abe8e5bb331fa3d721af33d /test/regress/run_regression
parentff498bb43b3d3785bdb894974678e65926de62ab (diff)
Adding regression test scrubbing.
Diffstat (limited to 'test/regress/run_regression')
-rwxr-xr-xtest/regress/run_regression25
1 files changed, 21 insertions, 4 deletions
diff --git a/test/regress/run_regression b/test/regress/run_regression
index 868a69116..a04e488d8 100755
--- a/test/regress/run_regression
+++ b/test/regress/run_regression
@@ -77,6 +77,7 @@ tmpbenchmark=
if expr "$benchmark" : '.*\.smt$' &>/dev/null; then
lang=smt1
if test -e "$benchmark.expect"; then
+ scrubber=`grep '^% SCRUBBER: ' "$benchmark.expect" | sed 's,^% SCRUBBER: ,,'`
expected_output=`grep '^% EXPECT: ' "$benchmark.expect" | sed 's,^% EXPECT: ,,'`
expected_error=`grep '^% EXPECT-ERROR: ' "$benchmark.expect" | sed 's,^% EXPECT-ERROR: ,,'`
expected_exit_status=`grep -m 1 '^% EXIT: ' "$benchmark.expect" | perl -pe 's,^% EXIT: ,,;s,\r,,'`
@@ -84,7 +85,8 @@ if expr "$benchmark" : '.*\.smt$' &>/dev/null; then
if [ -z "$expected_exit_status" ]; then
expected_exit_status=0
fi
- elif grep '^% \(PROOF\|EXPECT\|EXPECT-ERROR\|EXIT\|COMMAND-LINE\): ' "$benchmark" "$benchmark" &>/dev/null; then
+ elif grep '^% \(PROOF\|EXPECT\|EXPECT-ERROR\|EXIT\|COMMAND-LINE\|SCRUBBER\): ' "$benchmark" "$benchmark" &>/dev/null; then
+ scrubber=`grep '^% SCRUBBER: ' "$benchmark" | sed 's,^% SCRUBBER: ,,'`
expected_output=`grep '^% EXPECT: ' "$benchmark" | sed 's,^% EXPECT: ,,'`
expected_error=`grep '^% EXPECT-ERROR: ' "$benchmark" | sed 's,^% EXPECT-ERROR: ,,'`
expected_exit_status=`grep -m 1 '^% EXIT: ' "$benchmark" | perl -pe 's,^% EXIT: ,,;s,\r,,'`
@@ -92,7 +94,7 @@ if expr "$benchmark" : '.*\.smt$' &>/dev/null; then
# old mktemp from coreutils 7.x is broken, can't do XXXX in the middle
# this frustrates our auto-language-detection
gettemp tmpbenchmark cvc4_benchmark.smt.$$.XXXXXXXXXX
- grep -v '^% \(PROOF\|EXPECT\|EXPECT-ERROR\|EXIT\|COMMAND-LINE\): ' "$benchmark" >"$tmpbenchmark"
+ grep -v '^% \(PROOF\|EXPECT\|EXPECT-ERROR\|EXIT\|COMMAND-LINE\|SCRUBBER\): ' "$benchmark" >"$tmpbenchmark"
if [ -z "$expected_exit_status" ]; then
expected_exit_status=0
fi
@@ -111,6 +113,7 @@ if expr "$benchmark" : '.*\.smt$' &>/dev/null; then
elif expr "$benchmark" : '.*\.smt2$' &>/dev/null; then
lang=smt2
if test -e "$benchmark.expect"; then
+ scrubber=`grep '^% SCRUBBER: ' "$benchmark.expect" | sed 's,^% SCRUBBER: ,,'`
expected_output=`grep '^% EXPECT: ' "$benchmark.expect" | sed 's,^% EXPECT: ,,'`
expected_error=`grep '^% EXPECT-ERROR: ' "$benchmark.expect" | sed 's,^% EXPECT-ERROR: ,,'`
expected_exit_status=`grep -m 1 '^% EXIT: ' "$benchmark.expect" | perl -pe 's,^% EXIT: ,,;s,\r,,'`
@@ -118,7 +121,8 @@ elif expr "$benchmark" : '.*\.smt2$' &>/dev/null; then
if [ -z "$expected_exit_status" ]; then
expected_exit_status=0
fi
- elif grep '^; \(EXPECT\|EXPECT-ERROR\|EXIT\|COMMAND-LINE\): ' "$benchmark" "$benchmark" &>/dev/null; then
+ elif grep '^; \(EXPECT\|EXPECT-ERROR\|EXIT\|COMMAND-LINE\|SCRUBBER\): ' "$benchmark" "$benchmark" &>/dev/null; then
+ scrubber=`grep '^; SCRUBBER: ' "$benchmark" | sed 's,^; SCRUBBER: ,,'`
expected_output=`grep '^; EXPECT: ' "$benchmark" | sed 's,^; EXPECT: ,,'`
expected_error=`grep '^; EXPECT-ERROR: ' "$benchmark" | sed 's,^; EXPECT-ERROR: ,,'`
expected_exit_status=`grep -m 1 '^; EXIT: ' "$benchmark" | perl -pe 's,^; EXIT: ,,;s,\r,,'`
@@ -139,6 +143,7 @@ elif expr "$benchmark" : '.*\.smt2$' &>/dev/null; then
fi
elif expr "$benchmark" : '.*\.cvc$' &>/dev/null; then
lang=cvc4
+ scrubber=`grep '^% SCRUBBER: ' "$benchmark" | sed 's,^% SCRUBBER: ,,'`
expected_output=$(grep '^% EXPECT: ' "$benchmark")
expected_error=`grep '^% EXPECT-ERROR: ' "$benchmark" | sed 's,^% EXPECT-ERROR: ,,'`
if [ -z "$expected_output" -a -z "$expected_error" ]; then
@@ -154,6 +159,7 @@ elif expr "$benchmark" : '.*\.cvc$' &>/dev/null; then
elif expr "$benchmark" : '.*\.p$' &>/dev/null; then
lang=tptp
command_line=--finite-model-find
+ scrubber=`grep '^% SCRUBBER: ' "$benchmark" | sed 's,^% SCRUBBER: ,,'`
expected_output=$(grep '^% EXPECT: ' "$benchmark")
expected_error=`grep '^% EXPECT-ERROR: ' "$benchmark" | sed 's,^% EXPECT-ERROR: ,,'`
if [ -z "$expected_output" -a -z "$expected_error" ]; then
@@ -182,6 +188,7 @@ elif expr "$benchmark" : '.*\.p$' &>/dev/null; then
elif expr "$benchmark" : '.*\.sy$' &>/dev/null; then
lang=sygus
if test -e "$benchmark.expect"; then
+ scrubber=`grep '^% SCRUBBER: ' "$benchmark.expect" | sed 's,^% SCRUBBER: ,,'`
expected_output=`grep '^% EXPECT: ' "$benchmark.expect" | sed 's,^% EXPECT: ,,'`
expected_error=`grep '^% EXPECT-ERROR: ' "$benchmark.expect" | sed 's,^% EXPECT-ERROR: ,,'`
expected_exit_status=`grep -m 1 '^% EXIT: ' "$benchmark.expect" | perl -pe 's,^% EXIT: ,,;s,\r,,'`
@@ -189,7 +196,8 @@ elif expr "$benchmark" : '.*\.sy$' &>/dev/null; then
if [ -z "$expected_exit_status" ]; then
expected_exit_status=0
fi
- elif grep '^; \(EXPECT\|EXPECT-ERROR\|EXIT\|COMMAND-LINE\): ' "$benchmark" "$benchmark" &>/dev/null; then
+ elif grep '^; \(EXPECT\|EXPECT-ERROR\|EXIT\|COMMAND-LINE\|SCRUBBER\): ' "$benchmark" "$benchmark" &>/dev/null; then
+ scrubber=`grep '^; SCRUBBER: ' "$benchmark" | sed 's,^; SCRUBBER: ,,'`
expected_output=`grep '^; EXPECT: ' "$benchmark" | sed 's,^; EXPECT: ,,'`
expected_error=`grep '^; EXPECT-ERROR: ' "$benchmark" | sed 's,^; EXPECT-ERROR: ,,'`
expected_exit_status=`grep -m 1 '^; EXIT: ' "$benchmark" | perl -pe 's,^; EXIT: ,,;s,\r,,'`
@@ -306,6 +314,15 @@ else
echo "$actual_error" >"$errfilefix"
fi
+# Scrub the output file if a scrubber has been specified.
+if [ -n "$scrubber" ]; then
+ echo "About to scrub $outfile using $scrubber"
+ mv "$outfile" "$outfile.prescrub"
+ cat "$outfile.prescrub" | eval $scrubber >"$outfile"
+else
+ echo "not scrubbing"
+fi
+
diffs=`diff -u --strip-trailing-cr "$expoutfile" "$outfile"`
diffexit=$?
diffserr=`diff -u --strip-trailing-cr "$experrfile" "$errfilefix"`
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback