]> git.ipfire.org Git - thirdparty/cups.git/blame - test/5.6-lpr.sh
Merge changes from CUPS 1.5svn-r9385.
[thirdparty/cups.git] / test / 5.6-lpr.sh
CommitLineData
ef416fc2 1#!/bin/sh
2#
75bd9771 3# "$Id: 5.6-lpr.sh 7409 2008-03-29 00:26:03Z mike $"
ef416fc2 4#
5# Test the lpr command.
6#
b9faaae1 7# Copyright 2007-2009 by Apple Inc.
ef416fc2 8# Copyright 1997-2005 by Easy Software Products, all rights reserved.
9#
10# These coded instructions, statements, and computer programs are the
bc44d920 11# property of Apple Inc. and are protected by Federal copyright
12# law. Distribution and use rights are outlined in the file "LICENSE.txt"
13# which should have been included with this file. If this file is
14# file is missing or damaged, see the license at "http://www.cups.org/".
ef416fc2 15#
16
17echo "LPR Default Test"
18echo ""
839a51c8
MS
19echo " lpr testfile.pdf"
20../berkeley/lpr testfile.pdf 2>&1
ef416fc2 21if test $? != 0; then
22 echo " FAILED"
23 exit 1
24else
25 echo " PASSED"
26fi
27echo ""
28
29echo "LPR Destination Test"
30echo ""
839a51c8
MS
31echo " lpr -P Test2 testfile.jpg"
32../berkeley/lpr -P Test2 testfile.jpg 2>&1
33if test $? != 0; then
34 echo " FAILED"
35 exit 1
36else
37 echo " PASSED"
38fi
39echo ""
40
41echo "LPR Options Test"
42echo ""
43echo " lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf"
44../berkeley/lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf 2>&1
ef416fc2 45if test $? != 0; then
46 echo " FAILED"
47 exit 1
48else
49 echo " PASSED"
50fi
51echo ""
52
839a51c8 53echo "LPR Flood Test ($1 times in parallel)"
ef416fc2 54echo ""
839a51c8
MS
55echo " lpr -P Test1 testfile.jpg"
56echo " lpr -P Test2 testfile.jpg"
ef416fc2 57i=0
58while test $i -lt $1; do
59 echo " flood copy $i..." 1>&2
b9faaae1
MS
60
61 j=1
62 while test $j -le $2; do
63 ../berkeley/lpr -P test-$j testfile.jpg 2>&1
64 j=`expr $j + 1`
65 done
66
ef416fc2 67 ../berkeley/lpr -P Test1 testfile.jpg 2>&1 &
839a51c8 68 ../berkeley/lpr -P Test2 testfile.jpg 2>&1 &
ef416fc2 69 lprpid=$!
b9faaae1 70
ef416fc2 71 i=`expr $i + 1`
72done
73wait $lppid
74if test $? != 0; then
75 echo " FAILED"
76 exit 1
77else
78 echo " PASSED"
79fi
80echo ""
81
839a51c8
MS
82./waitjobs.sh
83
ef416fc2 84#
75bd9771 85# End of "$Id: 5.6-lpr.sh 7409 2008-03-29 00:26:03Z mike $".
ef416fc2 86#