runtests 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. #
  2. # Runs the test files that you'll find in this directory. You may want to change
  3. # the definitions of PRINT and BINDIR. The default definition of BINDIR assumes
  4. # the translators are installed in /usr/lbin/postscript, while PRINT just writes
  5. # everything to stdout. Unrecognized options (ie. options other than -P and -B)
  6. # are passed along to the translator.
  7. #
  8. # For example, if postio is installed in /usr/lbin/postscript, the following runs
  9. # the dmd bitmap translator on the test file ./postdmd1 and sends the output to
  10. # the printer attached to /dev/tty01.
  11. #
  12. # runtests -P'/usr/lbin/postscript/postio -l /dev/tty01' -pland postdmd
  13. #
  14. OPTIONS=
  15. PRINT=cat
  16. BINDIR=/usr/lbin/postscript
  17. for i do
  18. case $i in
  19. -P*) PRINT=`echo $i | sed s/-P//`;;
  20. -B*) BINDIR=`echo $i | sed s/-B//`;;
  21. -*) OPTIONS="$OPTIONS $i";;
  22. *) break;;
  23. esac
  24. shift
  25. done
  26. for i do
  27. for j in ${i}*; do
  28. if [ ! -r "$j" ]; then
  29. break
  30. fi
  31. case $j in
  32. dpost*)
  33. $BINDIR/dpost $OPTIONS $j | $PRINT;;
  34. postbgi*)
  35. $BINDIR/postbgi $OPTIONS $j | $PRINT;;
  36. posttek*)
  37. $BINDIR/posttek $OPTIONS $j | $PRINT;;
  38. postdmd*)
  39. $BINDIR/postdmd $OPTIONS $j | $PRINT;;
  40. postmd*)
  41. $BINDIR/postmd $OPTIONS $j | $PRINT;;
  42. postdaisy*)
  43. $BINDIR/postdaisy $OPTIONS $j | $PRINT;;
  44. postprint*)
  45. $BINDIR/postprint $OPTIONS $j | $PRINT;;
  46. postplot*)
  47. $BINDIR/postplot $OPTIONS $j | $PRINT;;
  48. postgif*)
  49. $BINDIR/postgif $OPTIONS $j | $PRINT;;
  50. troff*)
  51. pic $j | tbl | eqn | troff -mm -Tpost | $BINDIR/dpost $OPTIONS | $PRINT;;
  52. man*)
  53. troff -man -Tpost $j | $BINDIR/dpost $OPTIONS | $PRINT;;
  54. esac
  55. done
  56. done