]>
Commit | Line | Data |
---|---|---|
ef416fc2 | 1 | #!/bin/sh |
2 | # | |
503b54c9 | 3 | # Test the lpr command. |
ef416fc2 | 4 | # |
503b54c9 MS |
5 | # Copyright 2007-2014 by Apple Inc. |
6 | # Copyright 1997-2005 by Easy Software Products, all rights reserved. | |
ef416fc2 | 7 | # |
503b54c9 MS |
8 | # These coded instructions, statements, and computer programs are the |
9 | # property of Apple Inc. and are protected by Federal copyright | |
10 | # law. Distribution and use rights are outlined in the file "LICENSE.txt" | |
11 | # which should have been included with this file. If this file is | |
12 | # file is missing or damaged, see the license at "http://www.cups.org/". | |
ef416fc2 | 13 | # |
14 | ||
15 | echo "LPR Default Test" | |
16 | echo "" | |
839a51c8 | 17 | echo " lpr testfile.pdf" |
a2326b5b | 18 | $VALGRIND ../berkeley/lpr testfile.pdf 2>&1 |
ef416fc2 | 19 | if test $? != 0; then |
20 | echo " FAILED" | |
21 | exit 1 | |
22 | else | |
23 | echo " PASSED" | |
24 | fi | |
25 | echo "" | |
26 | ||
27 | echo "LPR Destination Test" | |
28 | echo "" | |
a29fd7dd MS |
29 | echo " lpr -P Test3 -o fit-to-page testfile.jpg" |
30 | $VALGRIND ../berkeley/lpr -P Test3 -o fit-to-page testfile.jpg 2>&1 | |
839a51c8 MS |
31 | if test $? != 0; then |
32 | echo " FAILED" | |
33 | exit 1 | |
34 | else | |
35 | echo " PASSED" | |
36 | fi | |
37 | echo "" | |
38 | ||
39 | echo "LPR Options Test" | |
40 | echo "" | |
41 | echo " lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf" | |
a2326b5b | 42 | $VALGRIND ../berkeley/lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf 2>&1 |
ef416fc2 | 43 | if test $? != 0; then |
44 | echo " FAILED" | |
45 | exit 1 | |
46 | else | |
47 | echo " PASSED" | |
48 | fi | |
49 | echo "" | |
50 | ||
839a51c8 | 51 | echo "LPR Flood Test ($1 times in parallel)" |
ef416fc2 | 52 | echo "" |
839a51c8 MS |
53 | echo " lpr -P Test1 testfile.jpg" |
54 | echo " lpr -P Test2 testfile.jpg" | |
ef416fc2 | 55 | i=0 |
2a8db0cd | 56 | pids="" |
ef416fc2 | 57 | while test $i -lt $1; do |
b9faaae1 MS |
58 | j=1 |
59 | while test $j -le $2; do | |
a2326b5b | 60 | $VALGRIND ../berkeley/lpr -P test-$j testfile.jpg 2>&1 |
b9faaae1 MS |
61 | j=`expr $j + 1` |
62 | done | |
63 | ||
a2326b5b | 64 | $VALGRIND ../berkeley/lpr -P Test1 testfile.jpg 2>&1 & |
2a8db0cd | 65 | pids="$pids $!" |
a2326b5b | 66 | $VALGRIND ../berkeley/lpr -P Test2 testfile.jpg 2>&1 & |
2a8db0cd | 67 | pids="$pids $!" |
b9faaae1 | 68 | |
ef416fc2 | 69 | i=`expr $i + 1` |
70 | done | |
2a8db0cd | 71 | wait $pids |
ef416fc2 | 72 | if test $? != 0; then |
73 | echo " FAILED" | |
74 | exit 1 | |
75 | else | |
76 | echo " PASSED" | |
77 | fi | |
78 | echo "" | |
79 | ||
839a51c8 | 80 | ./waitjobs.sh |