summaryrefslogtreecommitdiff
path: root/sys/src/cmd/postscript/tests/runtests
blob: 0c349b9435d68326f0782984d2d2037c03b54179 (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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
#
# Runs the test files that you'll find in this directory. You may want to change
# the definitions of PRINT and BINDIR. The default definition of BINDIR assumes
# the translators are installed in /usr/lbin/postscript, while PRINT just writes
# everything to stdout. Unrecognized options (ie. options other than -P and -B)
# are passed along to the translator.
#
# For example, if postio is installed in /usr/lbin/postscript, the following runs
# the dmd bitmap translator on the test file ./postdmd1 and sends the output to
# the printer attached to /dev/tty01.
#
#	runtests -P'/usr/lbin/postscript/postio -l /dev/tty01' -pland postdmd
#

OPTIONS=
PRINT=cat
BINDIR=/usr/lbin/postscript

for i do
    case $i in
	-P*) PRINT=`echo $i | sed s/-P//`;;

	-B*) BINDIR=`echo $i | sed s/-B//`;;

	-*)  OPTIONS="$OPTIONS $i";;

	*)   break;;
    esac
    shift
done

for i do
    for j in ${i}*; do
	if [ ! -r "$j" ]; then
	    break
	fi
	case $j in
	    dpost*)
		$BINDIR/dpost $OPTIONS $j | $PRINT;;

	    postbgi*)
		$BINDIR/postbgi $OPTIONS $j | $PRINT;;

	    posttek*)
		$BINDIR/posttek $OPTIONS $j | $PRINT;;

	    postdmd*)
		$BINDIR/postdmd $OPTIONS $j | $PRINT;;

	    postmd*)
		$BINDIR/postmd $OPTIONS $j | $PRINT;;

	    postdaisy*)
		$BINDIR/postdaisy $OPTIONS $j | $PRINT;;

	    postprint*)
		$BINDIR/postprint $OPTIONS $j | $PRINT;;

	    postplot*)
		$BINDIR/postplot $OPTIONS $j | $PRINT;;

	    postgif*)
		$BINDIR/postgif $OPTIONS $j | $PRINT;;

	    troff*)
		pic $j | tbl | eqn | troff -mm -Tpost | $BINDIR/dpost $OPTIONS | $PRINT;;

	    man*)
		troff -man -Tpost $j | $BINDIR/dpost $OPTIONS | $PRINT;;
	esac
    done
done