X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Fscripts%2Fdo_tests.sh;h=687b7f8c07b928bb0afae68f628672e7aa3cc8b9;hb=7d7f729471b4d5ebafa1b915096974e726cc13c6;hp=e8e4ddda4e9cc19e1b9dbcc8418f0a22e5b989c8;hpb=1276d3c7b85f4edc049a5d68a6120816fe64c806;p=helm.git diff --git a/helm/matita/scripts/do_tests.sh b/helm/matita/scripts/do_tests.sh index e8e4ddda4..687b7f8c0 100755 --- a/helm/matita/scripts/do_tests.sh +++ b/helm/matita/scripts/do_tests.sh @@ -12,9 +12,14 @@ if [ "$1" = "-twice" ]; then shift TWICE=1 fi +if [ "$1" = "-keep-logs" ]; then + shift + KEEP=1 +fi COMPILER=$1 shift +CLEANCOMPILER=`echo $COMPILER | cut -d ' ' -f 1` CLEANER=$1 shift LOGFILE=$1 @@ -26,11 +31,12 @@ TODO="$@" if [ -z "$COMPILER" -o -z "$CLEANER" -o -z "$LOGFILE" -o -z "$EXPECTED" -o -z "$TODO" ]; then echo echo "usage: " - echo " do_tests.sh [-no-color] [-twice] ./compiler ./cleaner logfile expected_result test.ma ..." + echo " do_tests.sh [-no-color] [-twice] [-keep-logs] ./compiler ./cleaner logfile expected_result test.ma ..." echo echo "options: " echo " -no-color Do not use vt100 colors" echo " -twice Run each test twice but show only the second run times" + echo " -keep-logs Do not dele __* files" echo echo "If expected_result is OK the result will be OK if the test compiles." echo "Otherwise if expected_result is FAIL the result will be OK if the test" @@ -40,12 +46,13 @@ if [ -z "$COMPILER" -o -z "$CLEANER" -o -z "$LOGFILE" -o -z "$EXPECTED" -o -z "$ exit 1 fi -LOG=.__log -DIFF=.__diff export TIMEFORMAT="%2lR %2lU %2lS" for T in $TODO; do - printf "$COMPILER\t%-30s " $T + TT=`echo $T | sed s?/?.?`.not_for_matita + LOG=__log_$TT + DIFF=__diff_$TT + printf "$CLEANCOMPILER\t%-30s " $T if [ "$TWICE" = "1" ]; then $CLEANER $T 1>/dev/null 2>/dev/null $COMPILER $T 1>/dev/null 2>/dev/null @@ -62,7 +69,6 @@ for T in $TODO; do else diff $LOG `basename $T .ma`.log > $DIFF RC=$? - rm -f $LOG fi fi if [ $RC = 0 ]; then @@ -71,6 +77,9 @@ for T in $TODO; do printf "$FAIL\t$TIMES\t$DO_TESTS_EXTRA\n"; cat $DIFF fi - rm -f $DIFF + if [ "$KEEP" != "1" ]; then + rm -f $LOG + rm -f $DIFF + fi exit $RC done