shithub: riscv

ref: 4fb65ae3e84f536a9b924082b7c59a30d5802e6b
dir: /sys/src/cmd/postscript/tests/runtests/

View raw version
#
# 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