| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #!/usr/bin/env bash
- CIVAS=${CIVAS-../bin32/civas}
- CIVVM=${CIVVM-../bin32/civvm}
- CIVCC=${CIVVM-../bin32/civcc}
- REAL_CFLAGS=
- TESTSUITE_CFLAGS=
- total_tests=0
- failed_tests=0
- # The real tests: compile a file, run it and compare the output to the
- # output of the reference compiler.
- for f in *.cvc
- do
- total_tests=$((total_tests+1))
- echo -n $f:" "
- if $CIVCC $REAL_CFLAGS -o tmp.s $f > tmp.out 2>&1 &&
- $CIVAS tmp.s -o tmp.o > tmp.out 2>&1 &&
- $CIVVM tmp.o > tmp.out 2>&1 &&
- mv tmp.out tmp.res &&
- diff tmp.res ${f%.*}.out --side-by-side --ignore-space-change > tmp.out 2>&1
- then
- echo success
- else
- echo failed
- echo -------------------------------
- cat tmp.out
- echo -------------------------------
- echo
- failed_tests=$((failed_tests+1))
- fi
- rm -f tmp.res tmp.s tmp.o tmp.out
- done
- # Tests from the testsuite. Only check if exit code of compiler equals 0.
- for f in testsuite/assignment/*.cvc testsuite/easy_test/*.cvc testsuite/functional_test/*.cvc
- do
- total_tests=$((total_tests+1))
- echo -n $f:" "
- if $CIVCC $TESTSUITE_CFLAGS $f -o tmp.s > /dev/null 2>&1
- then
- echo success
- else
- echo failed
- failed_tests=$((failed_tests+1))
- fi
- rm -f tmp.s
- done
- # Tests from the testsuite that must fail. Only check if exit code
- # of compiler does not equal 0.
- for f in testsuite/error_test/*.cvc
- do
- total_tests=$((total_tests+1))
- echo -n $f:" "
- if $CIVCC $TESTSUITE_CFLAGS $f -o tmp.s > /dev/null 2>&1
- then
- echo failed
- failed_tests=$((failed_tests+1))
- else
- echo success
- fi
- rm -f tmp.s
- done
- echo
- echo $total_tests tests, $failed_tests failures
|