1 # Define various parameters for use in test runs.
2 # Requires $test to be defined before sourcing.
6 echo "\$test not defined" >&2
10 if [ "${test}" != "driver" ]
12 echo "Running ${test} ..."
19 GUILE=`if test -f ../../guile/libguile/guile ; then echo ../../guile/libguile/guile; else echo guile ; fi`
20 GUILEFLAGS="-l ${cgendir}/guile.scm -s"
24 cgen_output_file=${test}.cgen.out
25 test_output_file=${test}.test.out
26 rm -f ${cgen_output_file} ${test_output_file}
28 tmp_match=match-${test}.tmp
29 tmp_expr=expr-${test}.tmp
30 rm -f ${tmp_match} ${tmp_expr}
35 [ $# == 1 ] || { echo "missing cpu_file" >&2 ; exit 1 ; }
38 if ! ${GUILE} ${GUILEFLAGS} ${cgendir}/cgen-testsuite.scm \
42 -T ${cgen_output_file} >& ${test_output_file}
44 fail "${test} run of cgen"
49 file=${test_output_file}
53 fail "FAIL found in test output:"
57 grep "^MATCH: " $file | sed -e 's/^MATCH://' > ${tmp_match}
58 grep "^EXPR: " $file | sed -e 's/^EXPR://' > ${tmp_expr}
60 if ! cmp -s ${tmp_match} ${tmp_expr}
62 fail "Differences from expected output:"
63 diff ${tmp_match} ${tmp_expr}