6 if [ "$1" = "-no-color" ]; then
11 if [ "$1" = "-twice" ]; then
18 CLEANCOMPILER=`echo $COMPILER | cut -d ' ' -f 1`
27 if [ -z "$COMPILER" -o -z "$CLEANER" -o -z "$LOGFILE" -o -z "$EXPECTED" -o -z "$TODO" ]; then
30 echo " do_tests.sh [-no-color] [-twice] ./compiler ./cleaner logfile expected_result test.ma ..."
33 echo " -no-color Do not use vt100 colors"
34 echo " -twice Run each test twice but show only the second run times"
36 echo "If expected_result is OK the result will be OK if the test compiles."
37 echo "Otherwise if expected_result is FAIL the result will be OK if the test"
38 echo "does not compile and the generated output is equal to test.log."
39 echo "The value of the DO_TESTS_EXTRA evironment variable"
40 echo "will be appended to each line."
47 export TIMEFORMAT="%2lR %2lU %2lS"
49 printf "$CLEANCOMPILER\t%-30s " $T
50 if [ "$TWICE" = "1" ]; then
51 $CLEANER $T 1>/dev/null 2>/dev/null
52 $COMPILER $T 1>/dev/null 2>/dev/null
54 $CLEANER $T 1>/dev/null 2>/dev/null
55 TIMES=`(time $COMPILER $T > $LOG 2>&1) 2>&1`
59 if [ $EXPECTED = "FAIL" ]; then
61 echo "The test was successful but it should have failed!" > $DIFF
64 diff $LOG `basename $T .ma`.log > $DIFF
70 printf "$OK\t$TIMES\t$DO_TESTS_EXTRA\n"
72 printf "$FAIL\t$TIMES\t$DO_TESTS_EXTRA\n";