summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/triptrap-sh
blob: 8e2a15bbe66397e7a7119a94b4090c43d10b6f4f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /bin/sh
# shell script to run TRIP and TRAP tests and create diffs.
#
#   Copyright (C) 2010, 2011 Peter Breitenlohner <tex-live@tug.org>
#
#   This file is free software; the copyright holder
#   gives unlimited permission to copy and/or distribute it,
#   with or without modifications, as long as this notice is preserved.
#
# Due to filename conflicts, these tests must be run sequentially.

me=`basename $0`

tmp=$me.$$

trap "rm -f $tmp" 1 2 13 15

echo "$me: Running TRIP and TRAP tests and creating diffs."
for file
do
  case $file in
  trip.diffs) tst=trip; msg='TRIP test for TeX';;
  mftrap.diffs) tst=trap; msg='TRAP test for Metafont';;
  mptrap.diffs) tst=mplibdir/mptrap; msg='MPTRAP test for MetaPost';;
  etrip.diffs) tst=etexdir/etrip; msg='e-TRIP test for e-TeX';;
  ptrip.diffs) tst=ptexdir/ptrip; msg='TRIP test for pTeX';;
  eptrip.diffs) tst=eptexdir/eptrip; msg='e-TRIP test for e-pTeX';;
  uptrip.diffs) tst=uptexdir/uptrip; msg='TRIP test for upTeX';;
  euptrip.diffs) tst=euptexdir/euptrip; msg='e-TRIP test for e-upTeX';;
  *) echo "$me: Bad argument \`$file'"; exit 1;;
  esac
  echo ">>> Running $msg."
  $MAKE TESTS=$tst.test check-am >$tmp 2>&1 \
    && grep "PASS: $tst\.test" $tmp >/dev/null 2>&1 \
    || { echo "FAIL: $tst.test"; exit 1; }
  echo ">>> Running $msg." >$file
  sed -e "1,/^>>> Running $msg.\$/d" \
      -e "/^PASS: /,\$d" \
      -e "s%$srcdir/triptrap%SRCDIR/triptrap%" \
      -e "s%$srcdir/etexdir%SRCDIR/etexdir%" \
      -e "s%$srcdir/ptexdir%SRCDIR/ptexdir%" \
      -e "s%$srcdir/eptexdir%SRCDIR/eptexdir%" \
      -e "s%$srcdir/uptexdir%SRCDIR/uptexdir%" \
      -e "s%$srcdir/euptexdir%SRCDIR/euptexdir%" \
      $tmp >>$file
  echo "PASS: $tst.test" >>$file
  rm -f $tmp
  echo "PASS: $tst.test"
done
echo "$me: All done"