]>
Commit | Line | Data |
---|---|---|
1 | #!/bin/sh | |
2 | # | |
3 | # Test the lpr command. | |
4 | # | |
5 | # Copyright © 2007-2019 by Apple Inc. | |
6 | # Copyright © 1997-2005 by Easy Software Products, all rights reserved. | |
7 | # | |
8 | # Licensed under Apache License v2.0. See the file "LICENSE" for more | |
9 | # information. | |
10 | # | |
11 | ||
12 | echo "LPR Default Test" | |
13 | echo "" | |
14 | echo " lpr testfile.pdf" | |
15 | $runcups $VALGRIND ../berkeley/lpr ../examples/testfile.pdf 2>&1 | |
16 | if test $? != 0; then | |
17 | echo " FAILED" | |
18 | exit 1 | |
19 | else | |
20 | echo " PASSED" | |
21 | fi | |
22 | echo "" | |
23 | ||
24 | echo "LPR Destination Test" | |
25 | echo "" | |
26 | echo " lpr -P Test3 -o fit-to-page testfile.jpg" | |
27 | $runcups $VALGRIND ../berkeley/lpr -P Test3 -o fit-to-page ../examples/testfile.jpg 2>&1 | |
28 | if test $? != 0; then | |
29 | echo " FAILED" | |
30 | exit 1 | |
31 | else | |
32 | echo " PASSED" | |
33 | fi | |
34 | echo "" | |
35 | ||
36 | echo "LPR Options Test" | |
37 | echo "" | |
38 | echo " lpr -P Test1 -o number-up=4 -o job-sheets=standard,none testfile.pdf" | |
39 | $runcups $VALGRIND ../berkeley/lpr -P Test1 -o number-up=4 -o job-sheets=standard,none ../examples/testfile.pdf 2>&1 | |
40 | if test $? != 0; then | |
41 | echo " FAILED" | |
42 | exit 1 | |
43 | else | |
44 | echo " PASSED" | |
45 | fi | |
46 | echo "" | |
47 | ||
48 | echo "LPR Flood Test ($1 times in parallel)" | |
49 | echo "" | |
50 | echo " lpr -P Test1 testfile.jpg" | |
51 | echo " lpr -P Test2 testfile.jpg" | |
52 | i=0 | |
53 | pids="" | |
54 | while test $i -lt $1; do | |
55 | j=1 | |
56 | while test $j -le $2; do | |
57 | $runcups $VALGRIND ../berkeley/lpr -P test-$j ../examples/testfile.jpg 2>&1 | |
58 | j=`expr $j + 1` | |
59 | done | |
60 | ||
61 | $runcups $VALGRIND ../berkeley/lpr -P Test1 ../examples/testfile.jpg 2>&1 & | |
62 | pids="$pids $!" | |
63 | $runcups $VALGRIND ../berkeley/lpr -P Test2 ../examples/testfile.jpg 2>&1 & | |
64 | pids="$pids $!" | |
65 | ||
66 | i=`expr $i + 1` | |
67 | done | |
68 | wait $pids | |
69 | if test $? != 0; then | |
70 | echo " FAILED" | |
71 | exit 1 | |
72 | else | |
73 | echo " PASSED" | |
74 | fi | |
75 | echo "" | |
76 | ||
77 | ./waitjobs.sh |