X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Fscripts%2Fdo_tests.sh;h=5e8b0d583bda5f1cd31f768fc61f609089fc38e7;hb=062eb0af0b92e5f7f99f90fb453e9fd010b47e7a;hp=080ff2adaf9a81908ffde12dc814ecb59ec2e996;hpb=244b44d6490eeb5f7cb89e83cfb6e22e9394ba11;p=helm.git diff --git a/helm/matita/scripts/do_tests.sh b/helm/matita/scripts/do_tests.sh index 080ff2ada..5e8b0d583 100755 --- a/helm/matita/scripts/do_tests.sh +++ b/helm/matita/scripts/do_tests.sh @@ -15,14 +15,16 @@ fi COMPILER=$1 shift +CLEANER=$1 +shift LOGFILE=$1 shift TODO="$@" -if [ -z "$COMPILER" -o -z "$LOGFILE" -o -z "$TODO" ]; then +if [ -z "$COMPILER" -o -z "$CLEANER" -o -z "$LOGFILE" -o -z "$TODO" ]; then echo echo "usage: " - echo " do_tests.sh [-no-color] [-twice] ./compiler logfile tests.ma ..." + echo " do_tests.sh [-no-color] [-twice] ./compiler ./cleaner logfile tests.ma ..." echo echo "options: " echo " -no-color Do not use vt100 colors" @@ -35,17 +37,20 @@ fi TMP=.__temp.txt +export TIMEFORMAT="%2lR %2lU %2lS" for T in $TODO; do - echo -en "$COMPILER\t$T\t" + printf "$COMPILER\t%-30s " $T if [ "$TWICE" = "1" ]; then + $CLEANER $T 1>/dev/null 2>/dev/null $COMPILER $T 1>/dev/null 2>/dev/null fi - /usr/bin/time --quiet -o $TMP -f "%E\t%U\t%S" $COMPILER $T >> $LOGFILE 2>&1 - if [ $? = 0 ]; then - echo -e "$OK\t`cat $TMP`\t$DO_TESTS_EXTRA" + $CLEANER $T 1>/dev/null 2>/dev/null + TIMES=`(time $COMPILER $T >> $LOGFILE 2>&1) 2>&1` + RC=$?; + if [ $RC = 0 ]; then + printf "$OK\t$TIMES\t$DO_TESTS_EXTRA\n" else - echo -e "$FAIL\t`cat $TMP`\t$DO_TESTS_EXTRA" + printf "$FAIL\t$TIMES\t$DO_TESTS_EXTRA\n"; + exit $RC fi done - -rm $TMP