#!/bin/sh
#
# "$Id: runtests.sh 251 2005-06-17 02:53:12Z mike $"
#
#   Test script for the CUPS PPD Compiler.
#
#   Tests small and media media sizes with several test files and uses
#   common finishing options available on high-end printers (ignored on
#   low-end devices...)
#
#   Copyright 2002-2005 by Easy Software Products.
#
#   These coded instructions, statements, and computer programs are the
#   property of Easy Software Products and are protected by Federal
#   copyright law.  Distribution and use rights are outlined in the file
#   "LICENSE.txt" which should have been included with this file.  If this
#   file is missing or damaged please contact Easy Software Products
#   at:
#
#       Attn: CUPS Licensing Information
#       Easy Software Products
#       44141 Airport View Drive, Suite 204
#       Hollywood, Maryland 20636 USA
#
#       Voice: (301) 373-9603
#       EMail: cups-info@cups.org
#         WWW: http://www.cups.org
#
# Usage:
#
#   sh runtests.sh printername
#

if test $# != 1; then
	echo Usage: sh runtests.sh printername
	exit 1
fi

printer=$1

echo "1) Test US media sizes"
echo "2) Test non-US media sizes"
echo ""
echo "Choose one:"
read number

case "$number" in
	1*)
	for media in letter tabloid; do
		lp -d $printer -o page-label="$printer" -o media=$media testprint.ps
		lp -d $printer -o page-label="$printer" -o media=$media -o scaling=100 testprint.jpg
	done

	lp -d $printer -o page-label="$printer" -o media=letter \
		-o sides=two-sided-long-edge -o cupsStaple=SinglePortrait \
		-o cupsOutputBin=Finisher -o JCLARStapleLocation=Staple5 \
		-o OutputBin=Output2 document-letter.ps
	lp -d $printer -o page-label="$printer" -o media=tabloid \
		-o sides=two-sided-short-edge -o cupsStaple=Saddle \
		-o cupsOutputBin=SaddleStitch -o cupsBooklet=True \
		-o JCLARStapleLocation=Staple7 \
		-o OutputBin=Output3 document-tabloid.ps
	;;

	2*)
	for media in a4 a3; do
		lp -d $printer -o page-label="$printer" -o media=$media testprint.ps
		lp -d $printer -o page-label="$printer" -o media=$media -o scaling=100 testprint.jpg
	done

	lp -d $printer -o page-label="$printer" -o media=a4 \
		-o sides=two-sided-long-edge -o cupsStaple=SinglePortrait \
		-o cupsOutputBin=Finisher document-a4.ps
	lp -d $printer -o page-label="$printer" -o media=a3 \
		-o sides=two-sided-short-edge -o cupsStaple=Saddle \
		-o cupsOutputBin=SaddleStitch -o cupsBooklet=True document-a3.ps
	;;

	*)
	echo "Please re-run and choose 1 or 2..."
	exit 1
	;;
esac

#
# End of "$Id: runtests.sh 251 2005-06-17 02:53:12Z mike $".
#
