X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fmatita%2Fscripts%2Fdo_tests.sh;h=d2e7eec91cc34cc1d537f38a4a90cbbf14e3645e;hb=bbe7741f3bbaacb93f2876c018dace82f5e929b8;hp=737ea7c5efd42de28d6359f0126f56ba96ee5068;hpb=f81860fd2d2c23d53b58873a1d0e3feaa0247b92;p=helm.git diff --git a/helm/matita/scripts/do_tests.sh b/helm/matita/scripts/do_tests.sh index 737ea7c5e..d2e7eec91 100755 --- a/helm/matita/scripts/do_tests.sh +++ b/helm/matita/scripts/do_tests.sh @@ -8,6 +8,10 @@ if [ "$1" = "-no-color" ]; then OK="OK" FAIL="FAIL" fi +if [ "$1" = "-twice" ]; then + shift + TWICE=1 +fi COMPILER=$1 shift @@ -18,7 +22,11 @@ TODO="$@" if [ -z "$COMPILER" -o -z "$LOGFILE" -o -z "$TODO" ]; then echo echo "usage: " - echo " do_tests.sh [-no-color] ./compiler logfile tests.ma ..." + echo " do_tests.sh [-no-color] [-twice] ./compiler logfile tests.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 echo "The value of the DO_TESTS_EXTRA evironment variable" echo "will be appended to each line." @@ -28,12 +36,15 @@ fi TMP=.__temp.txt for T in $TODO; do - echo -en "$COMPILER\t$T\t" - /usr/bin/time --quiet -o $TMP -f "%E\t%U\t%S" $COMPILER $T >> $LOGFILE 2>&1 + printf "$COMPILER\t%-30s " $T + if [ "$TWICE" = "1" ]; then + $COMPILER $T 1>/dev/null 2>/dev/null + fi + /usr/bin/time --quiet -o $TMP -f "%E %U %S" $COMPILER $T >> $LOGFILE 2>&1 if [ $? = 0 ]; then - echo -e "$OK\t`cat $TMP`\t$DO_TESTS_EXTRA" + printf "$OK\t`cat $TMP`\t$DO_TESTS_EXTRA\n" else - echo -e "$FAIL\t`cat $TMP`\t$DO_TESTS_EXTRA" + printf "$FAIL\t`cat $TMP`\t$DO_TESTS_EXTRA\n" fi done