| 1 | #! /bin/sh |
| 2 | # $Id: triptrap-sh 57558 2021-01-30 01:42:07Z karl $ |
| 3 | # shell script to run TRIP and TRAP tests and create diffs. |
| 4 | # |
| 5 | # Copyright 2015-2021 Karl Berry <[email protected]> |
| 6 | # Copyright 2010-2015 Peter Breitenlohner <[email protected]> |
| 7 | # |
| 8 | # This file is free software; the copyright holder |
| 9 | # gives unlimited permission to copy and/or distribute it, |
| 10 | # with or without modifications, as long as this notice is preserved. |
| 11 | # |
| 12 | # Due to filename conflicts, these tests must be run sequentially. |
| 13 | |
| 14 | me=`basename $0` |
| 15 | |
| 16 | tmp=$me.$$ |
| 17 | |
| 18 | trap "rm -f $tmp" 1 2 13 15 |
| 19 | |
| 20 | echo "$me: Running TRIP and TRAP tests and creating diffs." |
| 21 | rc=0 |
| 22 | for file |
| 23 | do |
| 24 | case $file in |
| 25 | trip.diffs) tst=triptest; msg='TRIP test for TeX';; |
| 26 | mftrap.diffs) tst=mftraptest; msg='TRAP test for Metafont';; |
| 27 | mfluatrap.diffs) tst=mfluadir/mfluatraptest; msg='TRAP test for MFLua';; |
| 28 | mfluajittrap.diffs) tst=mfluajitdir/mfluajittraptest; msg='TRAP test for MFLuaJIT';; |
| 29 | mptrap.diffs) tst=mplibdir/mptraptest; msg='MPTRAP test for MetaPost';; |
| 30 | etrip.diffs) tst=etexdir/etriptest; msg='e-TRIP test for e-TeX';; |
| 31 | ptrip.diffs) tst=ptexdir/ptriptest; msg='TRIP test for pTeX';; |
| 32 | eptrip.diffs) tst=eptexdir/eptriptest; msg='e-TRIP test for e-pTeX';; |
| 33 | uptrip.diffs) tst=uptexdir/uptriptest; msg='TRIP test for upTeX';; |
| 34 | euptrip.diffs) tst=euptexdir/euptriptest; msg='e-TRIP test for e-upTeX';; |
| 35 | *) echo "$me: Bad argument \`$file'"; exit 1;; |
| 36 | esac |
| 37 | echo ">>> Running $msg." |
| 38 | is_OK=: |
| 39 | $MAKE TESTS=$tst.test check-am >$tmp 2>&1 \ |
| 40 | && grep "PASS: $tst.test" $tmp >/dev/null 2>&1 \ |
| 41 | || { echo "FAIL: $tst.test"; is_OK=false; } |
| 42 | |
| 43 | sed -e "s%$abs_srcdir/%SRCDIR/%" \ |
| 44 | -e "s%\.\./%./%" \ |
| 45 | $tst.log >$file |
| 46 | |
| 47 | rm -f $tst.out # previous output file, if any. |
| 48 | |
| 49 | $is_OK && { |
| 50 | echo "PASS: $tst.test" >>$file |
| 51 | echo "PASS: $tst.test" |
| 52 | rm -f $tmp |
| 53 | } || { |
| 54 | echo "FAIL: $tst.test" >>$file |
| 55 | # preserve our output file in case of failure |
| 56 | mv $tmp $tst.out |
| 57 | rc=1 |
| 58 | } |
| 59 | done |
| 60 | echo "$me: All done" |
| 61 | exit $rc |