]> git.ipfire.org Git - thirdparty/cups.git/blame_incremental - test/5.5-lp.sh
Bring back RPM test script, tweak makesrcdist to work.
[thirdparty/cups.git] / test / 5.5-lp.sh
... / ...
CommitLineData
1#!/bin/sh
2#
3# Test the lp command.
4#
5# Copyright 2007-2014 by Apple Inc.
6# Copyright 1997-2005 by Easy Software Products, all rights reserved.
7#
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/".
13#
14
15echo "LP Default Test"
16echo ""
17echo " lp testfile.pdf"
18$VALGRIND ../systemv/lp testfile.pdf 2>&1
19if test $? != 0; then
20 echo " FAILED"
21 exit 1
22else
23 echo " PASSED"
24fi
25echo ""
26
27echo "LP Destination Test"
28echo ""
29echo " lp -d Test3 -o fit-to-page testfile.jpg"
30$VALGRIND ../systemv/lp -d Test3 -o fit-to-page testfile.jpg 2>&1
31if test $? != 0; then
32 echo " FAILED"
33 exit 1
34else
35 echo " PASSED"
36fi
37echo ""
38
39echo "LP Options Test"
40echo ""
41echo " lp -d Test1 -P 1-4 -o job-sheets=classified,classified testfile.pdf"
42$VALGRIND ../systemv/lp -d Test1 -P 1-4 -o job-sheets=classified,classified testfile.pdf 2>&1
43if test $? != 0; then
44 echo " FAILED"
45 exit 1
46else
47 echo " PASSED"
48fi
49echo ""
50
51echo "LP Flood Test ($1 times in parallel)"
52echo ""
53echo " lp -d Test1 testfile.jpg"
54echo " lp -d Test2 testfile.jpg"
55i=0
56pids=""
57while test $i -lt $1; do
58 j=1
59 while test $j -le $2; do
60 $VALGRIND ../systemv/lp -d test-$j testfile.jpg 2>&1
61 j=`expr $j + 1`
62 done
63
64 $VALGRIND ../systemv/lp -d Test1 testfile.jpg 2>&1 &
65 pids="$pids $!"
66 $VALGRIND ../systemv/lp -d Test2 testfile.jpg 2>&1 &
67 pids="$pids $!"
68
69 i=`expr $i + 1`
70done
71wait $pids
72if test $? != 0; then
73 echo " FAILED"
74 exit 1
75else
76 echo " PASSED"
77fi
78echo ""
79
80./waitjobs.sh
81
82echo "LPSTAT Completed Jobs Order Test"
83echo ""
84echo " lpstat -W completed -o"
85$VALGRIND ../systemv/lpstat -W completed -o | tee $BASE/lpstat-completed.txt
86if test "`uniq -d $BASE/lpstat-completed.txt`" != ""; then
87 echo " FAILED"
88 exit 1
89else
90 echo " PASSED"
91fi
92echo ""