6 if [ "$1" = "-no-color" ]; then
11 if [ "$1" = "-twice" ]; then
15 if [ "$1" = "-keep-logs" ]; then
22 CLEANCOMPILER=`echo $COMPILER | cut -d ' ' -f 1`
31 if [ -z "$COMPILER" -o -z "$CLEANER" -o -z "$LOGFILE" -o -z "$EXPECTED" -o -z "$TODO" ]; then
34 echo " do_tests.sh [-no-color] [-twice] [-keep-logs] ./compiler ./cleaner logfile expected_result test.ma ..."
37 echo " -no-color Do not use vt100 colors"
38 echo " -twice Run each test twice but show only the second run times"
39 echo " -keep-logs Do not dele __* files"
41 echo "If expected_result is OK the result will be OK if the test compiles."
42 echo "Otherwise if expected_result is FAIL the result will be OK if the test"
43 echo "does not compile and the generated output is equal to test.log."
44 echo "The value of the DO_TESTS_EXTRA evironment variable"
45 echo "will be appended to each line."
50 export TIMEFORMAT="%2lR %2lU %2lS"
52 TT=`echo $T | sed s?/?.?`.not_for_matita
55 printf "$CLEANCOMPILER\t%-30s " $T
56 if [ "$TWICE" = "1" ]; then
57 $CLEANER $T 1>/dev/null 2>/dev/null
58 $COMPILER $T 1>/dev/null 2>/dev/null
60 $CLEANER $T 1>/dev/null 2>/dev/null
61 TIMES=`(time $COMPILER $T > $LOG 2>&1) 2>&1`
65 if [ $EXPECTED = "FAIL" ]; then
67 echo "The test was successful but it should have failed!" > $DIFF
70 diff $LOG `basename $T .ma`.log > $DIFF
75 printf "$OK\t$TIMES\t$DO_TESTS_EXTRA\n"
77 printf "$FAIL\t$TIMES\t$DO_TESTS_EXTRA\n";
80 if [ "$KEEP" != "1" ]; then