aboutsummaryrefslogtreecommitdiffstats
path: root/test/regression/Runtest
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>2018-08-24 14:02:43 +0200
committerXavier Leroy <xavier.leroy@inria.fr>2018-08-24 14:02:43 +0200
commit3f153b74876e0a5dce14402f98d2d348ecfacc95 (patch)
tree5834b6c5594168bee70dba1e893185a19416946d /test/regression/Runtest
parent78ce76b87a7de88dcdf6d742428d5474dac19867 (diff)
downloadcompcert-kvx-3f153b74876e0a5dce14402f98d2d348ecfacc95.tar.gz
compcert-kvx-3f153b74876e0a5dce14402f98d2d348ecfacc95.zip
Improve execution of regression tests
- Make it possible to skip tests on some platforms - Make it possible to expect a failure (typically: of the reference interpreter) - Stop on error
Diffstat (limited to 'test/regression/Runtest')
-rwxr-xr-xtest/regression/Runtest28
1 files changed, 25 insertions, 3 deletions
diff --git a/test/regression/Runtest b/test/regression/Runtest
index ad2a58f1..f693219a 100755
--- a/test/regression/Runtest
+++ b/test/regression/Runtest
@@ -9,6 +9,9 @@ out="test$$.log"
rm -f $out
trap "rm -f $out" 0 INT QUIT
+# Is the test expected to fail?
+expect_fail=false
+
# The architecture and the bitsize
arch=`sed -n -e 's/^ARCH=//p' ../../Makefile.config`
bits=`sed -n -e 's/^BITSIZE=//p' ../../Makefile.config`
@@ -26,10 +29,23 @@ else
ref=""
fi
+# Special conditions
+
+if test -f "$name.cond"; then
+ RUN=0 SKIP=1 EXPECT_FAIL=2 sh "$name.cond"
+ case "$?" in
+ 1) echo "$name: skipped"; exit 0;;
+ 2) expect_fail=true;;
+ esac
+fi
+
# Administer the test
if $SIMU $* > $out
then
- if test -n "$ref"; then
+ if $expect_fail; then
+ echo "$name: ERROR (should have failed but did not)"
+ exit 2
+ elif test -n "$ref"; then
if cmp -s "$out" "$ref"; then
echo "$name: passed"
exit 0
@@ -43,7 +59,13 @@ then
exit 0
fi
else
- echo "$name: EXECUTION FAILED (status $?)"
- exit 2
+ retcode=$?
+ if $expect_fail; then
+ echo "$name: passed (failed as expected)"
+ exit 0
+ else
+ echo "$name: EXECUTION FAILED (status $retcode)"
+ exit 2
+ fi
fi