summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2013-11-06 20:06:50 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2013-11-06 20:06:50 +0000
commit4bdbabf76b1cd03e38ae57be482ae1f740b7f50c (patch)
tree5b3cabfeb5788b351b06566855eee33e96593d6c
parent64e918f26a51b721a83ade132a7774be67287d04 (diff)
downloadcups-4bdbabf76b1cd03e38ae57be482ae1f740b7f50c.tar.gz
Fix "make check" on Linux (<rdar://problem/14292998>)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/branches/branch-1.7@11395 a1ca3aef-8c08-0410-bb20-df032aa958be
-rw-r--r--systemv/lpstat.c31
-rw-r--r--test/onepage-a4-300-black-1.pwg.gzbin0 -> 152826 bytes
-rw-r--r--test/onepage-letter-300-black-1.pwg.gzbin0 -> 137724 bytes
-rwxr-xr-xtest/run-stp-tests.sh119
-rw-r--r--test/test.convs9
-rw-r--r--test/testhp.ppd29
6 files changed, 122 insertions, 66 deletions
diff --git a/systemv/lpstat.c b/systemv/lpstat.c
index 8ead3f143..3bdca13a7 100644
--- a/systemv/lpstat.c
+++ b/systemv/lpstat.c
@@ -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
index 000000000..0a559fc16
--- /dev/null
+++ b/test/onepage-a4-300-black-1.pwg.gz
Binary files 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
index 000000000..8fd7386e3
--- /dev/null
+++ b/test/onepage-letter-300-black-1.pwg.gz
Binary files differ
diff --git a/test/run-stp-tests.sh b/test/run-stp-tests.sh
index 656503a5a..6ea17f45d 100755
--- a/test/run-stp-tests.sh
+++ b/test/run-stp-tests.sh
@@ -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
index 000000000..94ce07a06
--- /dev/null
+++ b/test/test.convs
@@ -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
+
diff --git a/test/testhp.ppd b/test/testhp.ppd
index 6200c7aba..2a508cd60 100644
--- a/test/testhp.ppd
+++ b/test/testhp.ppd
@@ -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
@@ -133,9 +133,10 @@
*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