]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix "make check" on Linux (<rdar://problem/14292998>)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 6 Nov 2013 20:06:50 +0000 (20:06 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 6 Nov 2013 20:06:50 +0000 (20:06 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.7@11395 a1ca3aef-8c08-0410-bb20-df032aa958be

systemv/lpstat.c
test/onepage-a4-300-black-1.pwg.gz [new file with mode: 0644]
test/onepage-letter-300-black-1.pwg.gz [new file with mode: 0644]
test/run-stp-tests.sh
test/test.convs [new file with mode: 0644]
test/testhp.ppd

index 8ead3f143f8b0c42260ba173258c4643641e9132..3bdca13a73c8df33a4f86d8af25ef468aac74b14 100644 (file)
@@ -1,30 +1,16 @@
 /*
  * "$Id$"
  *
- *   "lpstat" command for CUPS.
+ * "lpstat" command for CUPS.
  *
- *   Copyright 2007-2013 by Apple Inc.
- *   Copyright 1997-2006 by Easy Software Products.
+ * Copyright 2007-2013 by Apple Inc.
+ * Copyright 1997-2006 by Easy Software Products.
  *
- *   These coded instructions, statements, and computer programs are the
- *   property of Apple Inc. and are protected by Federal copyright
- *   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
- *   which should have been included with this file.  If this file is
- *   file is missing or damaged, see the license at "http://www.cups.org/".
- *
- * Contents:
- *
- *   main()           - Parse options and show status information.
- *   check_dest()     - Verify that the named destination(s) exists.
- *   match_list()     - Match a name from a list of comma or space-separated
- *                      names.
- *   show_accepting() - Show acceptance status.
- *   show_classes()   - Show printer classes.
- *   show_default()   - Show default destination.
- *   show_devices()   - Show printer devices.
- *   show_jobs()      - Show active print jobs.
- *   show_printers()  - Show printers.
- *   show_scheduler() - Show scheduler status.
+ * These coded instructions, statements, and computer programs are the
+ * property of Apple Inc. and are protected by Federal copyright
+ * law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+ * which should have been included with this file.  If this file is
+ * file is missing or damaged, see the license at "http://www.cups.org/".
  */
 
 /*
@@ -109,6 +95,7 @@ main(int  argc,                              /* I - Number of command-line arguments */
              _cupsLangPuts(stdout, cupsServer());
            else
              _cupsLangPrintf(stdout, "%s:%d", cupsServer(), ippPort());
+           op = 'H';
             break;
 
         case 'P' : /* Show paper types */
diff --git a/test/onepage-a4-300-black-1.pwg.gz b/test/onepage-a4-300-black-1.pwg.gz
new file mode 100644 (file)
index 0000000..0a559fc
Binary files /dev/null and b/test/onepage-a4-300-black-1.pwg.gz differ
diff --git a/test/onepage-letter-300-black-1.pwg.gz b/test/onepage-letter-300-black-1.pwg.gz
new file mode 100644 (file)
index 0000000..8fd7386
Binary files /dev/null and b/test/onepage-letter-300-black-1.pwg.gz differ
index 656503a5a324592c003a52bc0e7dd7413c0791d2..6ea17f45de0f67985ef1bbaafc1dc559b09ca8d1 100755 (executable)
@@ -346,38 +346,97 @@ ln -s $root/templates /tmp/cups-$user/share
 # Local filters and configuration files...
 #
 
+instfilter() {
+       # instfilter src dst format
+       #
+       # See if the filter exists in a standard location; if so, make a
+       # symlink, otherwise create a dummy script for the specified format.
+       #
+       src="$1"
+       dst="$2"
+       format="$3"
+
+       for dir in /usr/libexec/cups/filter /usr/lib/cups/filter; do
+               if test -x "$dir/$src"; then
+                       ln -s "$dir/$src" "/tmp/cups-$user/bin/filter/$dst"
+                       return
+               fi
+       done
+
+       # Source filter not present, create a dummy filter
+       case $format in
+               passthru)
+                       ln -s gziptoany "/tmp/cups-$user/bin/filter/$dst"
+                       ;;
+               pdf)
+                       cat >"/tmp/cups-$user/bin/filter/$dst" <<EOF
+#!/bin/sh
+case "\$5" in
+       *media=a4* | *media=iso_a4* | *PageSize=A4*)
+               cat "$root/test/onepage-a4.pdf"
+               ;;
+       *)
+               cat "$root/test/onepage-letter.pdf"
+               ;;
+esac
+EOF
+                       chmod +x "/tmp/cups-$user/bin/filter/$dst"
+                       ;;
+               ps)
+                       cat >"/tmp/cups-$user/bin/filter/$dst" <<EOF
+#!/bin/sh
+case "\$5" in
+       *media=a4* | *media=iso_a4* | *PageSize=A4*)
+               cat "$root/test/onepage-a4.ps"
+               ;;
+       *)
+               cat "$root/test/onepage-letter.ps"
+               ;;
+esac
+EOF
+                       chmod +x "/tmp/cups-$user/bin/filter/$dst"
+                       ;;
+               raster)
+                       cat >"/tmp/cups-$user/bin/filter/$dst" <<EOF
+#!/bin/sh
+case "\$5" in
+       *media=a4* | *media=iso_a4* | *PageSize=A4*)
+               gunzip -c "$root/test/onepage-a4-300-black-1.pwg.gz"
+               ;;
+       *)
+               gunzip -c "$root/test/onepage-letter-300-black-1.pwg.gz"
+               ;;
+esac
+EOF
+                       chmod +x "/tmp/cups-$user/bin/filter/$dst"
+                       ;;
+       esac
+}
+ln -s $root/test/test.convs /tmp/cups-$user/share/mime
+
 if test `uname` = Darwin; then
-       ln -s /usr/libexec/cups/filter/cgpdfto* /tmp/cups-$user/bin/filter
-       ln -s /usr/libexec/cups/filter/cgbannertopdf /tmp/cups-$user/bin/filter
-       ln -s /usr/libexec/cups/filter/cgimagetopdf /tmp/cups-$user/bin/filter
-       ln -s /usr/libexec/cups/filter/cgtexttopdf /tmp/cups-$user/bin/filter
-       ln -s /usr/libexec/cups/filter/nsimagetopdf /tmp/cups-$user/bin/filter
-       ln -s /usr/libexec/cups/filter/nstexttopdf /tmp/cups-$user/bin/filter
-       ln -s /usr/libexec/cups/filter/pictwpstops /tmp/cups-$user/bin/filter
-       ln -s /usr/libexec/cups/filter/pstoappleps /tmp/cups-$user/bin/filter
-       ln -s /usr/libexec/cups/filter/pstocupsraster /tmp/cups-$user/bin/filter
-       ln -s /usr/libexec/cups/filter/pstopdffilter /tmp/cups-$user/bin/filter
-       ln -s /usr/libexec/cups/filter/rastertourf /tmp/cups-$user/bin/filter
-       ln -s /usr/libexec/cups/filter/xhtmltopdf /tmp/cups-$user/bin/filter
-
-       if test -f /private/etc/cups/apple.types; then
-               ln -s /private/etc/cups/apple.* /tmp/cups-$user/share/mime
-       elif test -f /usr/share/cups/mime/apple.types; then
-               ln -s /usr/share/cups/mime/apple.* /tmp/cups-$user/share/mime
-       fi
+       instfilter cgbannertopdf bannertopdf pdf
+       instfilter cgimagetopdf imagetopdf pdf
+       instfilter cgpdftopdf pdftopdf passthru
+       instfilter cgpdftops pdftops ps
+       instfilter cgpdftoraster pdftoraster raster
+       instfilter cgtexttopdf texttopdf pdf
+       instfilter pstocupsraster pstoraster raster
+       instfilter pstopdffilter pstopdf pdf
 else
-       ln -s /usr/lib/cups/filter/bannertops /tmp/cups-$user/bin/filter
-       ln -s /usr/lib/cups/filter/imagetops /tmp/cups-$user/bin/filter
-       ln -s /usr/lib/cups/filter/imagetoraster /tmp/cups-$user/bin/filter
-       ln -s /usr/lib/cups/filter/pdftops /tmp/cups-$user/bin/filter
-       ln -s /usr/lib/cups/filter/texttops /tmp/cups-$user/bin/filter
-
-       ln -s /usr/share/cups/mime/legacy.convs /tmp/cups-$user/share/mime
-       ln -s /usr/share/cups/charsets /tmp/cups-$user/share
-       if test -f $root/data/psglyphs; then
-               ln -s /usr/share/cups/data/psglyphs $root/data
+       instfilter bannertopdf bannertopdf pdf
+       instfilter bannertops bannertops ps
+       instfilter imagetopdf imagetopdf pdf
+       instfilter pdftopdf pdftopdf passthru
+       instfilter pdftops pdftops ps
+       instfilter pdftoraster pdftoraster raster
+       instfilter pstoraster pstoraster raster
+       instfilter texttopdf texttopdf pdf
+
+       if test -d /usr/share/cups/charsets; then
+               ln -s /usr/share/cups/charsets /tmp/cups-$user/share
        fi
-       ln -s /usr/share/cups/fonts /tmp/cups-$user/share
 fi
 
 #
@@ -853,7 +912,7 @@ else
 fi
 
 # Warning log messages
-count=`$GREP '^W ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'`
+count=`$GREP '^W ' /tmp/cups-$user/log/error_log | $GREP -v CreateProfile | wc -l | awk '{print $1}'`
 if test $count != 9; then
        echo "FAIL: $count warning messages, expected 9."
        $GREP '^W ' /tmp/cups-$user/log/error_log
diff --git a/test/test.convs b/test/test.convs
new file mode 100644 (file)
index 0000000..94ce07a
--- /dev/null
@@ -0,0 +1,9 @@
+# Test file listing potential filters for conversions
+application/pdf application/vnd.cups-pdf 100 pdftopdf
+application/pdf application/postscript 100 pdftops
+application/pdf application/vnd.cups-raster 100 pdftoraster
+application/postscript application/vnd.cups-raster 100 pstoraster
+application/vnd.cups-banner application/pdf 100 bannertopdf
+image/jpeg application/pdf 100 imagetopdf
+text/plain application/pdf 100 texttopdf
+
index 6200c7abaceaf0d828fdaa2171fa32d65ae69ea7..2a508cd60562057a275164aead8b24ad124549c7 100644 (file)
@@ -2,31 +2,31 @@
 *%
 *% "$Id: testhp.ppd 6649 2007-07-11 21:46:42Z mike $"
 *%
-*%   Test HP PPD file for CUPS.
+*% Test HP PPD file for CUPS.
 *%
-*%   Copyright 2007-2011 by Apple Inc.
-*%   Copyright 1997-2005 by Easy Software Products.
+*% Copyright 2007-2013 by Apple Inc.
+*% Copyright 1997-2005 by Easy Software Products.
 *%
-*%   These coded instructions, statements, and computer programs are the
-*%   property of Apple Inc. and are protected by Federal copyright
-*%   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-*%   which should have been included with this file.  If this file is
-*%   file is missing or damaged, see the license at "http://www.cups.org/".
+*% These coded instructions, statements, and computer programs are the
+*% property of Apple Inc. and are protected by Federal copyright
+*% law.  Distribution and use rights are outlined in the file "LICENSE.txt"
+*% which should have been included with this file.  If this file is
+*% file is missing or damaged, see the license at "http://www.cups.org/".
 *%
 *FormatVersion:        "4.3"
-*FileVersion:  "1.1"
+*FileVersion:  "1.7"
 *LanguageVersion: English
 *LanguageEncoding: ISOLatin1
 *PCFileName:   "TESTHP.PPD"
 *Manufacturer: "ESP"
 *Product:      "(CUPS v1.5)"
-*cupsVersion:  1.1
+*cupsVersion:  1.7
 *cupsManualCopies: True
 *cupsFilter:   "application/vnd.cups-raster 50 rastertohp"
 *cupsFilter2:  "application/vnd.cups-raster application/vnd.hp-pcl 50 rastertohp"
 *ModelName:     "Test HP Printer"
 *ShortNickName: "Test HP Printer"
-*NickName:      "Test HP Printer CUPS v1.1"
+*NickName:      "Test HP Printer CUPS v1.7"
 *PSVersion:    "(3010.000) 550"
 *LanguageLevel:        "3"
 *ColorDevice:  True
 
 *OpenUI *Resolution/Output Resolution: PickOne
 *OrderDependency: 20 AnySetup *Resolution
-*DefaultResolution: 100dpi
-*Resolution 75dpi/75 DPI: "<</HWResolution[75 75]>>setpagedevice"
-*Resolution 100dpi/100 DPI: "<</HWResolution[100 100]>>setpagedevice"
+*DefaultResolution: 300dpi
+*Resolution 150dpi/150 DPI: "<</HWResolution[150 150]>>setpagedevice"
+*Resolution 300dpi/300 DPI: "<</HWResolution[300 300]>>setpagedevice"
+*Resolution 600dpi/600 DPI: "<</HWResolution[600 600]>>setpagedevice"
 *CloseUI: *Resolution
 
 *OpenUI *ColorModel/Output Mode: PickOne