aboutsummaryrefslogtreecommitdiff
path: root/test-suite/check
diff options
context:
space:
mode:
authorherbelin2006-10-06 18:42:20 +0000
committerherbelin2006-10-06 18:42:20 +0000
commit860cfc641b4fd335b30cb6c5e61606ed6056cc3a (patch)
treea759cb8865b87dded3357c5bf0d4a866ac4d1389 /test-suite/check
parente4c88054ccf30e69f58d9ead1592102ecb0a1611 (diff)
Ajout d'un répertoire de test de la complexité
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@9222 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'test-suite/check')
-rwxr-xr-xtest-suite/check51
1 files changed, 41 insertions, 10 deletions
diff --git a/test-suite/check b/test-suite/check
index 99893f8826..a0dc8fd81f 100755
--- a/test-suite/check
+++ b/test-suite/check
@@ -103,18 +103,49 @@ test_interactive() {
done
}
+# La fonction suivante teste en interactif
+# It expects a line "(* Expected time < XXX.YYs *)" in the .v file
+# with exactly two digits after the dot
+test_complexity() {
+ if [ -f /proc/cpuinfo ]; then
+ bogomips=`sed -n -e "s/bogomips.*: \([0-9]*\).*/\1/p" /proc/cpuinfo | head -1`
+ else
+ bogomips=6120 # assume a i386 3Gz
+ fi
+ for f in $1/*.v; do
+ nbtests=`expr $nbtests + 1`
+ printf " "$f"..."
+ # compute effective user time * 100
+ res=`$command $f 2>&1 | sed -n -e "s/Finished transaction in .*(\([0-9]*\)\.\([0-9][0-9]\).*/\1\2/p" | head -1`
+ if [ $? != 0 ]; then
+ echo "Error! (should be accepted)"
+ else
+ # find expected time * 100
+ exp=`sed -n -e "s/(\*.*Expected time < \([0-9]\).\([0-9][0-9]\)s.*\*)/\1\2/p" $f`
+ if [ `expr \( $res \* $bogomips \) "<=" \( $exp \* 6120 \)` ]; then
+ echo "Ok"
+ nbtestsok=`expr $nbtestsok + 1`
+ else
+ echo "Error! (should run faster)"
+ fi
+ fi
+ done
+}
+
# Programme principal
-echo "Success tests"
-test_success success
-echo "Failure tests"
-test_failure failure
-echo "Output tests"
-test_output output
-echo "Parser tests"
-test_parser parser
-echo "Interactive tests"
-test_interactive interactive
+#echo "Success tests"
+#test_success success
+#echo "Failure tests"
+#test_failure failure
+#echo "Output tests"
+#test_output output
+#echo "Parser tests"
+#test_parser parser
+#echo "Interactive tests"
+#test_interactive interactive
+echo "Complexity tests"
+test_complexity complexity
echo "Module tests"
$coqtop -compile modules/Nat
$coqtop -compile modules/plik