]> git.ipfire.org Git - thirdparty/cups.git/blame - test/5.5-lp.sh
Import CUPS v2.0b1
[thirdparty/cups.git] / test / 5.5-lp.sh
CommitLineData
ef416fc2 1#!/bin/sh
2#
1a18c85c 3# "$Id: 5.5-lp.sh 12066 2014-07-30 18:30:44Z msweet $"
ef416fc2 4#
5# Test the lp command.
6#
1a18c85c 7# Copyright 2007-2014 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 "LP Default Test"
18echo ""
839a51c8 19echo " lp testfile.pdf"
a2326b5b 20$VALGRIND ../systemv/lp testfile.pdf 2>&1
ef416fc2 21if test $? != 0; then
22 echo " FAILED"
23 exit 1
24else
25 echo " PASSED"
26fi
27echo ""
28
29echo "LP Destination Test"
30echo ""
a29fd7dd
MS
31echo " lp -d Test3 -o fit-to-page testfile.jpg"
32$VALGRIND ../systemv/lp -d Test3 -o fit-to-page testfile.jpg 2>&1
839a51c8
MS
33if test $? != 0; then
34 echo " FAILED"
35 exit 1
36else
37 echo " PASSED"
38fi
39echo ""
40
41echo "LP Options Test"
42echo ""
43echo " lp -d Test1 -P 1-4 -o job-sheets=classified,classified testfile.pdf"
a2326b5b 44$VALGRIND ../systemv/lp -d Test1 -P 1-4 -o job-sheets=classified,classified testfile.pdf 2>&1
ef416fc2 45if test $? != 0; then
46 echo " FAILED"
47 exit 1
48else
49 echo " PASSED"
50fi
51echo ""
52
839a51c8 53echo "LP Flood Test ($1 times in parallel)"
ef416fc2 54echo ""
839a51c8
MS
55echo " lp -d Test1 testfile.jpg"
56echo " lp -d Test2 testfile.jpg"
ef416fc2 57i=0
1a18c85c 58pids=""
ef416fc2 59while test $i -lt $1; do
b9faaae1
MS
60 j=1
61 while test $j -le $2; do
a2326b5b 62 $VALGRIND ../systemv/lp -d test-$j testfile.jpg 2>&1
b9faaae1
MS
63 j=`expr $j + 1`
64 done
65
a2326b5b 66 $VALGRIND ../systemv/lp -d Test1 testfile.jpg 2>&1 &
1a18c85c 67 pids="$pids $!"
a2326b5b 68 $VALGRIND ../systemv/lp -d Test2 testfile.jpg 2>&1 &
1a18c85c 69 pids="$pids $!"
b9faaae1 70
ef416fc2 71 i=`expr $i + 1`
72done
1a18c85c 73wait $pids
ef416fc2 74if test $? != 0; then
75 echo " FAILED"
76 exit 1
77else
78 echo " PASSED"
79fi
80echo ""
81
839a51c8
MS
82./waitjobs.sh
83
1a18c85c
MS
84echo "LPSTAT Completed Jobs Order Test"
85echo ""
86echo " lpstat -W completed -o"
87$VALGRIND ../systemv/lpstat -W completed -o | tee $BASE/lpstat-completed.txt
88if test "`uniq -d $BASE/lpstat-completed.txt`" != ""; then
89 echo " FAILED"
90 exit 1
91else
92 echo " PASSED"
93fi
94echo ""
95
96
ef416fc2 97#
1a18c85c 98# End of "$Id: 5.5-lp.sh 12066 2014-07-30 18:30:44Z msweet $".
ef416fc2 99#