summaryrefslogtreecommitdiff
path: root/test-suite/check
diff options
context:
space:
mode:
Diffstat (limited to 'test-suite/check')
-rwxr-xr-xtest-suite/check81
1 files changed, 39 insertions, 42 deletions
diff --git a/test-suite/check b/test-suite/check
index fdc7b2d6..99893f88 100755
--- a/test-suite/check
+++ b/test-suite/check
@@ -3,16 +3,12 @@
# Automatic test of Coq
if [ "$1" = -byte ]; then
- command7="../bin/coqtop.byte -translate -q -batch -load-vernac-source"
+ coqtop="../bin/coqtop.byte -q -batch"
else
- command7="../bin/coqtop -translate -q -batch -load-vernac-source"
+ coqtop="../bin/coqtop -q -batch"
fi
-if [ "$1" = -byte ]; then
- command="../bin/coqtop.byte -q -batch -load-vernac-source"
-else
- command="../bin/coqtop -q -batch -load-vernac-source"
-fi
+command="$coqtop -top Top -load-vernac-source"
# on compte le nombre de tests et de succès
nbtests=0
@@ -24,34 +20,14 @@ test_success() {
for f in $1/*.v; do
nbtests=`expr $nbtests + 1`
printf " "$f"..."
- $command7 $f > /dev/null 2>&1
+ $command $f $2 > /dev/null 2>&1
if [ $? = 0 ]; then
- mv "$f"8 tmp8.v
- $command tmp8.v > /dev/null 2>&1
- if [ $? = 0 ]; then
- echo "Ok"
- nbtestsok=`expr $nbtestsok + 1`
- else
- echo "V8 Error! (should be accepted)"
- fi
- rm tmp8.v
+ echo "Ok"
+ nbtestsok=`expr $nbtestsok + 1`
else
- echo "V7 Error! (should be accepted)"
+ echo "Error! (should be accepted)"
fi
done
- for f in $1/*.v8; do
- nbtests=`expr $nbtests + 1`
- printf " "$f"..."
- cp $f tmp8.v
- $command tmp8.v > /dev/null 2>&1
- if [ $? = 0 ]; then
- echo "Ok"
- nbtestsok=`expr $nbtestsok + 1`
- else
- echo "V8 Error! (should be accepted)"
- fi
- rm tmp8.v
- done
}
# La fonction suivante teste le compilateur sur des fichiers qu'il doit
@@ -60,7 +36,7 @@ test_failure() {
for f in $1/*.v; do
nbtests=`expr $nbtests + 1`
printf " "$f"..."
- $command7 $f > /dev/null 2>&1
+ $command $f > /dev/null 2>&1
if [ $? != 0 ]; then
echo "Ok"
nbtestsok=`expr $nbtestsok + 1`
@@ -76,16 +52,16 @@ test_output() {
nbtests=`expr $nbtests + 1`
printf " "$f"..."
tmpoutput=`mktemp /tmp/coqcheck.XXXXXX`
- $command7 $f | tail +3 > $tmpoutput 2>&1
+ $command $f 2>&1 | grep -v "Welcome to Coq" | grep -v "Skipping rcfile loading" > $tmpoutput
foutput=`dirname $f`/`basename $f .v`.out
- diff $tmpoutput $foutput > /dev/null
+ diff $tmpoutput $foutput >& /dev/null
if [ $? = 0 ]; then
echo "Ok"
nbtestsok=`expr $nbtestsok + 1`
else
echo "Error! (unexpected output)"
- fi
- rm $tmpoutput
+ fi
+ rm $tmpoutput
done
}
@@ -107,25 +83,46 @@ test_parser() {
echo "Ok"
nbtestsok=`expr $nbtestsok + 1`
fi
- rm $tmpoutput
+ rm $tmpoutput
done
fi
}
+# La fonction suivante teste en interactif
+test_interactive() {
+ for f in $1/*.v; do
+ nbtests=`expr $nbtests + 1`
+ printf " "$f"..."
+ $coqtop < $f > /dev/null 2>&1
+ if [ $? = 0 ]; then
+ echo "Ok"
+ nbtestsok=`expr $nbtestsok + 1`
+ else
+ echo "Error! (should be accepted)"
+ fi
+ done
+}
+
# Programme principal
-# echo "Output tests"
-# test_output output
-echo "[Output tests are off]"
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 "Module tests"
+$coqtop -compile modules/Nat
+$coqtop -compile modules/plik
+test_success modules "-I modules -impredicative-set"
+
pourcentage=`expr 100 \* $nbtestsok / $nbtests`
echo
echo "$nbtestsok tests passed over $nbtests, i.e. $pourcentage %"
-
-
+#echo "Ideal-features tests"
+#test_success ideal-features