Index: test/run-stp-tests.sh =================================================================== --- test/run-stp-tests.sh (revision 9420) +++ test/run-stp-tests.sh (working copy) @@ -5,7 +5,7 @@ # Perform the complete set of IPP compliance tests specified in the # CUPS Software Test Plan. # -# Copyright 2007-2010 by Apple Inc. +# Copyright 2007-2011 by Apple Inc. # Copyright 1997-2007 by Easy Software Products, all rights reserved. # # These coded instructions, statements, and computer programs are the @@ -24,10 +24,20 @@ make # +# Solaris has a non-POSIX grep in /bin... +# + +if test -x /usr/xpg4/bin/grep; then + GREP=/usr/xpg4/bin/grep +else + GREP=grep +fi + +# # Figure out the proper echo options... # -if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then +if (echo "testing\c"; echo 1,2,3) | $GREP c >/dev/null; then ac_n=-n ac_c= else @@ -625,7 +635,7 @@ fi # Pages printed on Test1 (within 1 page for timing-dependent cancel issues) -count=`grep '^Test1 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'` +count=`$GREP '^Test1 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'` expected=`expr $pjobs \* 2 + 34` expected2=`expr $expected + 2` if test $count -lt $expected -a $count -gt $expected2; then @@ -638,7 +648,7 @@ fi # Paged printed on Test2 -count=`grep '^Test2 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'` +count=`$GREP '^Test2 ' /tmp/cups-$user/log/page_log | awk 'BEGIN{count=0}{count=count+$7}END{print count}'` expected=`expr $pjobs \* 2 + 3` if test $count != $expected; then echo "FAIL: Printer 'Test2' produced $count page(s), expected $expected." @@ -662,11 +672,11 @@ fi # Did CUPS-Get-Default get logged? -if grep -q CUPS-Get-Default /tmp/cups-$user/log/access_log; then +if $GREP -q CUPS-Get-Default /tmp/cups-$user/log/access_log; then echo "FAIL: CUPS-Get-Default logged with 'AccessLogLevel actions'" echo "

FAIL: CUPS-Get-Default logged with 'AccessLogLevel actions'

" >>$strfile echo "
" >>$strfile
-	grep CUPS-Get-Default /tmp/cups-$user/log/access_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
+	$GREP CUPS-Get-Default /tmp/cups-$user/log/access_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
 	echo "
" >>$strfile fail=`expr $fail + 1` else @@ -675,13 +685,13 @@ fi # Emergency log messages -count=`grep '^X ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^X ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count != 0; then echo "FAIL: $count emergency messages, expected 0." - grep '^X ' /tmp/cups-$user/log/error_log + $GREP '^X ' /tmp/cups-$user/log/error_log echo "

FAIL: $count emergency messages, expected 0.

" >>$strfile echo "
" >>$strfile
-	grep '^X ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
+	$GREP '^X ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
 	echo "
" >>$strfile fail=`expr $fail + 1` else @@ -690,13 +700,13 @@ fi # Alert log messages -count=`grep '^A ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^A ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count != 0; then echo "FAIL: $count alert messages, expected 0." - grep '^A ' /tmp/cups-$user/log/error_log + $GREP '^A ' /tmp/cups-$user/log/error_log echo "

FAIL: $count alert messages, expected 0.

" >>$strfile echo "
" >>$strfile
-	grep '^A ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
+	$GREP '^A ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
 	echo "
" >>$strfile fail=`expr $fail + 1` else @@ -705,13 +715,13 @@ fi # Critical log messages -count=`grep '^C ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^C ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count != 0; then echo "FAIL: $count critical messages, expected 0." - grep '^C ' /tmp/cups-$user/log/error_log + $GREP '^C ' /tmp/cups-$user/log/error_log echo "

FAIL: $count critical messages, expected 0.

" >>$strfile echo "
" >>$strfile
-	grep '^C ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
+	$GREP '^C ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
 	echo "
" >>$strfile fail=`expr $fail + 1` else @@ -720,13 +730,13 @@ fi # Error log messages -count=`grep '^E ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^E ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count != 18; then echo "FAIL: $count error messages, expected 18." - grep '^E ' /tmp/cups-$user/log/error_log + $GREP '^E ' /tmp/cups-$user/log/error_log echo "

FAIL: $count error messages, expected 18.

" >>$strfile echo "
" >>$strfile
-	grep '^E ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
+	$GREP '^E ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
 	echo "
" >>$strfile fail=`expr $fail + 1` else @@ -735,13 +745,13 @@ 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 | 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 + $GREP '^W ' /tmp/cups-$user/log/error_log echo "

FAIL: $count warning messages, expected 9.

" >>$strfile echo "
" >>$strfile
-	grep '^W ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
+	$GREP '^W ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
 	echo "
" >>$strfile fail=`expr $fail + 1` else @@ -750,13 +760,13 @@ fi # Notice log messages -count=`grep '^N ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^N ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count != 0; then echo "FAIL: $count notice messages, expected 0." - grep '^N ' /tmp/cups-$user/log/error_log + $GREP '^N ' /tmp/cups-$user/log/error_log echo "

FAIL: $count notice messages, expected 0.

" >>$strfile echo "
" >>$strfile
-	grep '^N ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
+	$GREP '^N ' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
 	echo "
" >>$strfile fail=`expr $fail + 1` else @@ -765,7 +775,7 @@ fi # Info log messages -count=`grep '^I ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^I ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count = 0; then echo "FAIL: $count info messages, expected more than 0." echo "

FAIL: $count info messages, expected more than 0.

" >>$strfile @@ -776,7 +786,7 @@ fi # Debug log messages -count=`grep '^D ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^D ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count = 0; then echo "FAIL: $count debug messages, expected more than 0." echo "

FAIL: $count debug messages, expected more than 0.

" >>$strfile @@ -787,7 +797,7 @@ fi # Debug2 log messages -count=`grep '^d ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` +count=`$GREP '^d ' /tmp/cups-$user/log/error_log | wc -l | awk '{print $1}'` if test $count = 0; then echo "FAIL: $count debug2 messages, expected more than 0." echo "

FAIL: $count debug2 messages, expected more than 0.

" >>$strfile @@ -798,13 +808,17 @@ fi # Page log file... -if grep -iq 'testfile.pdf na_letter_8.5x11in' /tmp/cups-$user/log/page_log; then - echo "PASS: page_log formatted correctly." - echo "

PASS: page_log formatted correctly.

" >>$strfile -else - echo "FAIL: page_log formatted incorrectly." - echo "

FAIL: page_log formatted incorrectly - no page size information.

" >>$strfile - fail=`expr $fail + 1` +if test `uname` = Darwin; then + # Currently just test for Mac OS X since others do not have UI to + # select a user-wide default media size... + if $GREP -iq 'testfile.pdf na_letter_8.5x11in' /tmp/cups-$user/log/page_log; then + echo "PASS: page_log formatted correctly." + echo "

PASS: page_log formatted correctly.

" >>$strfile + else + echo "FAIL: page_log formatted incorrectly." + echo "

FAIL: page_log formatted incorrectly - no page size information.

" >>$strfile + fail=`expr $fail + 1` + fi fi # Log files... @@ -815,7 +829,7 @@ echo "

error_log

" >>$strfile echo "
" >>$strfile
-grep -v '^d' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
+$GREP -v '^d' /tmp/cups-$user/log/error_log | sed -e '1,$s/&/&/g' -e '1,$s/>$strfile
 echo "
" >>$strfile echo "

page_log

" >>$strfile Index: ppdc/Makefile =================================================================== --- ppdc/Makefile (revision 9420) +++ ppdc/Makefile (working copy) @@ -3,7 +3,7 @@ # # Makefile for the CUPS PPD Compiler. # -# Copyright 2007-2010 by Apple Inc. +# Copyright 2007-2011 by Apple Inc. # Copyright 2002-2006 by Easy Software Products. # # These coded instructions, statements, and computer programs are the @@ -294,7 +294,7 @@ ./ppdc-static -I ../data sample.drv ./ppdi-static -I ../data -o sample-import.drv ppd/* ./ppdc-static -I ../data -d ppd2 sample-import.drv - if diff -qr ppd ppd2; then \ + if diff -r ppd ppd2 >/dev/null; then \ echo PPD import OK; \ else \ echo PPD import FAILED; \