]> git.ipfire.org Git - thirdparty/cups.git/blob - test/5.6-lpr.sh
Import CUPS v1.7.1
[thirdparty/cups.git] / test / 5.6-lpr.sh
1 #!/bin/sh
2 #
3 # "$Id: 5.6-lpr.sh 11396 2013-11-06 20:09:03Z msweet $"
4 #
5 # Test the lpr command.
6 #
7 # Copyright 2007-2012 by Apple Inc.
8 # Copyright 1997-2005 by Easy Software Products, all rights reserved.
9 #
10 # These coded instructions, statements, and computer programs are the
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/".
15 #
16
17 echo "LPR Default Test"
18 echo ""
19 echo " lpr testfile.pdf"
20 $VALGRIND ../berkeley/lpr testfile.pdf 2>&1
21 if test $? != 0; then
22 echo " FAILED"
23 exit 1
24 else
25 echo " PASSED"
26 fi
27 echo ""
28
29 echo "LPR Destination Test"
30 echo ""
31 echo " lpr -P Test3 -o fit-to-page testfile.jpg"
32 $VALGRIND ../berkeley/lpr -P Test3 -o fit-to-page testfile.jpg 2>&1
33 if test $? != 0; then
34 echo " FAILED"
35 exit 1
36 else
37 echo " PASSED"
38 fi
39 echo ""
40
41 echo "LPR Options Test"
42 echo ""
43 echo " lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf"
44 $VALGRIND ../berkeley/lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf 2>&1
45 if test $? != 0; then
46 echo " FAILED"
47 exit 1
48 else
49 echo " PASSED"
50 fi
51 echo ""
52
53 echo "LPR Flood Test ($1 times in parallel)"
54 echo ""
55 echo " lpr -P Test1 testfile.jpg"
56 echo " lpr -P Test2 testfile.jpg"
57 i=0
58 while test $i -lt $1; do
59 j=1
60 while test $j -le $2; do
61 $VALGRIND ../berkeley/lpr -P test-$j testfile.jpg 2>&1
62 j=`expr $j + 1`
63 done
64
65 $VALGRIND ../berkeley/lpr -P Test1 testfile.jpg 2>&1 &
66 $VALGRIND ../berkeley/lpr -P Test2 testfile.jpg 2>&1 &
67 lprpid=$!
68
69 i=`expr $i + 1`
70 done
71 wait $lppid
72 if test $? != 0; then
73 echo " FAILED"
74 exit 1
75 else
76 echo " PASSED"
77 fi
78 echo ""
79
80 ./waitjobs.sh
81
82 #
83 # End of "$Id: 5.6-lpr.sh 11396 2013-11-06 20:09:03Z msweet $".
84 #