]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
IPP Everywhere tests finally work for Windows. Fix an output bug in ipptool in quiet...
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 2 Sep 2014 13:37:30 +0000 (13:37 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Tue, 2 Sep 2014 13:37:30 +0000 (13:37 +0000)
git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@12143 a1ca3aef-8c08-0410-bb20-df032aa958be

everywhere/bonjour-tests.bat
everywhere/bonjour-value-tests.test
test/ipptool.c

index b4cbf41c3e25a4e0b2ef1765d440e11f05fbebc5..139b497a172d8bfdbac63aebff3e7ab6c69bba07 100644 (file)
@@ -1,4 +1,4 @@
-::@echo off
+@echo off
 ::
 ::  "$Id$"
 ::
 ::   bonjour-tests.bat 'Printer Name'
 ::
 
-set PLIST="%1 Bonjour Results.plist"
-
-:: Special case second argument: "_keys" and "_values" to show bad/missing TXT keys
-if not "%2" == "" (
-       echo "FAIL"
-       echo "<key>Errors</key><array>" >>"%PLIST%"
-       if not defined IPPFIND_TXT_ADMINURL (
-               echo "   adminurl is not set."
-               echo "<string>adminurl is not set.</string>" >>"%PLIST%"
-       ) else (
-               if "%2" == "_values" (
-                       set result=FAIL
-                       set scheme="%IPPFIND_TXT_ADMINURL:~0,7%"
-                       if "%scheme%" == "http://" set result=PASS
-                       set scheme="%IPPFIND_TXT_ADMINURL:~0,8%"
-                       if "%scheme%" == "https://" set result=PASS
-                       if "%result%" == "FAIL" (
-                               echo "   adminurl has bad value '%IPPFIND_TXT_ADMINURL%'."
-                               echo "<string>adminurl has bad value '%IPPFIND_TXT_ADMINURL%'.</string>" >>"%PLIST%"
-                       )
-               )
-       )
-
-       if not defined IPPFIND_TXT_PDL (
-               echo "   pdl is not set."
-               echo "<string>pdl is not set.</string>" >>"%PLIST%"
-       ) else (
-               if "%2" == "_values" (
-                       set temp="%IPPFIND_TXT_PDL:image/jpeg=%"
-                       if "%temp%" == "%IPPFIND_TXT_PDL%" (
-                               echo "   pdl is missing image/jpeg: '%IPPFIND_TXT_PDL%'"
-                               echo "<string>pdl is missing image/jpeg: '%IPPFIND_TXT_PDL%'.</string>" >>"%PLIST%"
-                       )
-
-                       set temp="%IPPFIND_TXT_PDL:image/pwg-raster=%"
-                       if "%temp%" == "%IPPFIND_TXT_PDL%" (
-                               echo "   pdl is missing image/pwg-raster: '%IPPFIND_TXT_PDL%'"
-                               echo "<string>pdl is missing image/pwg-raster: '%IPPFIND_TXT_PDL%'.</string>" >>"%PLIST%"
-                       )
-               )
-       )
-
-       if not defined IPPFIND_TXT_RP (
-               echo "   rp is not set."
-               echo "<string>rp is not set.</string>" >>"%PLIST%"
-       ) else (
-               if "%2" == "_values" (
-                       if not "%IPPFIND_TXT_RP%" == "ipp/print" (
-                               if not "%IPPFIND_TXT_RP:~0,10%" == "ipp/print/" (
-                                       echo "   rp has bad value '%IPPFIND_TXT_RP%'"
-                                       echo "<string>rp has bad value '%IPPFIND_TXT_RP%'.</string>" >>"%PLIST%"
-                               )
-                       )
-               )
-       )
-
-       if not defined IPPFIND_TXT_UUID (
-               echo "   UUID is not set."
-               echo "<string>UUID is not set.</string>" >>"%PLIST%"
-       ) else (
-               if "%2" == "_values" (
-                       :: This isn't as effective as the test in bonjour-tests.sh but still
-                       :: catches the most common error...
-                       set scheme="%IPPFIND_TXT_UUID:~0,9%"
-                       if "%scheme%" == "urn:uuid:" (
-                               echo "   UUID has bad value '%IPPFIND_TXT_UUID%'"
-                               echo "<string>UUID has bad value '%IPPFIND_TXT_UUID%'.</string>" >>"%PLIST%"
-                       )
-               )
-       )
-
-       if "%2" == "_values" (
-               ipptool -t -d "ADMINURL=%IPPFIND_TXT_ADMINURL%" -d "UUID=%IPPFIND_TXT_UUID%" %IPPFIND_SERVICE_URI% bonjour-value-tests.test
-               echo "<string>" >>"%PLIST%"
-               $IPPTOOL -t -d "ADMINURL=$IPPFIND_TXT_ADMINURL" -d "UUID=$IPPFIND_TXT_UUID" $IPPFIND_SERVICE_URI bonjour-value-tests.test | findstr /r "[TD]:" >>"%PLIST%"
-               echo "</string>" >>"%PLIST%"
-       )
-
-       echo "</array>" >>"%PLIST%"
-       echo "<key>Successful</key><false />" >>"%PLIST%"
-       echo "</dict>" >>"%PLIST%"
-
-       goto :eof
-)
-
+set PLIST=%1 Bonjour Results.plist
+echo Sending output to "%PLIST%"...
 
 :: Write the standard XML plist header...
-echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" >"%PLIST%"
-echo "<!DOCTYPE plist PUBLIC \"-//Apple Computer//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/PropertyList-1.0.dtd\">" >>"%PLIST%"
-echo "<plist version=\"1.0\">" >>"%PLIST%"
-echo "<dict>" >>"%PLIST%"
-echo "<key>Tests</key><array>" >>"%PLIST%"
+echo ^<?xml version=^"1.0^" encoding=^"UTF-8^"?^> >"%PLIST%"
+echo ^<!DOCTYPE plist PUBLIC ^"-//Apple Computer//DTD PLIST 1.0//EN^" ^"http://www.apple.com/DTDs/PropertyList-1.0.dtd^"^> >>"%PLIST%"
+echo ^<plist version=^"1.0^"^> >>"%PLIST%"
+echo ^<dict^> >>"%PLIST%"
+echo ^<key^>Tests^</key^>^<array^> >>"%PLIST%"
 
 set total=0
 set pass=0
@@ -120,208 +37,354 @@ set fail=0
 set skip=0
 
 :: B-1. IPP Browse test: Printers appear in a search for "_ipp._tcp,_print" services?
-call :start_test "B-1. IPP Browse test"
+set /a total+=1
+set <NUL /p="B-1. IPP Browse test: "
+echo ^<dict^>^<key^>Name^</key^>^<string^>B-1. IPP Browse test^</string^> >>"%PLIST%"
+echo ^<key^>FileId^</key^>^<string^>org.pwg.ipp-everywhere.20140826.bonjour^</string^> >>"%PLIST%"
+
 set result=FAIL
 ippfind _ipp._tcp,_print.local. --name "%1" --quiet && set result=PASS
 if "%result%" == "PASS" (
        set /a pass+=1
-       call :end_test PASS
 ) else (
        set /a fail+=1
-       call :end_test FAIL
 )
 
+echo %result%
+if "%result%" == "FAIL" (
+       echo ^<key^>Successful^</key^>^<false /^> >>"%PLIST%"
+) else (
+       echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+)
+echo ^</dict^> >>"%PLIST%"
+
 :: B-2. IPP TXT keys test: The IPP TXT record contains all required keys.
-call :start_test "B-2. IPP TXT keys test"
+set /a total+=1
+set <NUL /p="B-2. IPP TXT keys test: "
+echo ^<dict^>^<key^>Name^</key^>^<string^>B-2. IPP TXT keys test^</string^> >>"%PLIST%"
+echo ^<key^>FileId^</key^>^<string^>org.pwg.ipp-everywhere.20140826.bonjour^</string^> >>"%PLIST%"
+
 set result=FAIL
 ippfind "%1._ipp._tcp.local." --txt adminurl --txt pdl --txt rp --txt UUID --quiet && set result=PASS
 if "%result%" == "PASS" (
        set /a pass+=1
-       call :end_test PASS
 ) else (
        set /a fail+=1
-       ippfind "%1._ipp._tcp.local." -x bonjour-tests.bat "{service_name}" _keys ";"
+       echo ^<key^>Errors^</key^>^<array^>^<string^> >>"%PLIST%"
+       ippfind "%1._ipp._tcp.local." -x echo adminurl="{txt_adminurl}" ";" >>"%PLIST%"
+       ippfind "%1._ipp._tcp.local." -x echo pdl="{txt_pdl}" ";" >>"%PLIST%"
+       ippfind "%1._ipp._tcp.local." -x echo rp="{txt_rp}" ";" >>"%PLIST%"
+       ippfind "%1._ipp._tcp.local." -x echo UUID="{txt_uuid}" ";" >>"%PLIST%"
+       echo ^</string^>^</array^> >>"%PLIST%"
+)
+
+echo %result%
+if "%result%" == "FAIL" (
+       echo ^<key^>Successful^</key^>^<false /^> >>"%PLIST%"
+
+       ippfind "%1._ipp._tcp.local." -x echo adminurl="{txt_adminurl}" ";"
+       ippfind "%1._ipp._tcp.local." -x echo pdl="{txt_pdl}" ";"
+       ippfind "%1._ipp._tcp.local." -x echo rp="{txt_rp}" ";"
+       ippfind "%1._ipp._tcp.local." -x echo UUID="{txt_uuid}" ";"
+) else (
+       echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
 )
+echo ^</dict^> >>"%PLIST%"
 
 :: B-3. IPP Resolve test: Printer responds to an IPP Get-Printer-Attributes request using the resolved hostname, port, and resource path.
-call :start_test "B-3. IPP Resolve test"
+set /a total+=1
+set <NUL /p="B-3. IPP Resolve test: "
+echo ^<dict^>^<key^>Name^</key^>^<string^>B-3. IPP Resolve test^</string^> >>"%PLIST%"
+echo ^<key^>FileId^</key^>^<string^>org.pwg.ipp-everywhere.20140826.bonjour^</string^> >>"%PLIST%"
+
 set result=FAIL
 (ippfind "%1._ipp._tcp.local." --ls && set result=PASS) >nul:
 if "%result%" == "PASS" (
        set /a pass+=1
-       call :end_test PASS
 ) else (
        set /a fail+=1
-       echo "<key>Errors</key><array><string>" >>"%PLIST%"
+       echo ^<key^>Errors^</key^>^<array^>^<string^> >>"%PLIST%"
        ippfind "%1._ipp._tcp.local." --ls >>"%PLIST%"
-       echo "</string></array>" >>"%PLIST%"
-       call :end_test FAIL
+       echo ^</string^>^</array^> >>"%PLIST%"
 )
 
+echo %result%
+if "%result%" == "FAIL" (
+       echo ^<key^>Successful^</key^>^<false /^> >>"%PLIST%"
+) else (
+       echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+)
+echo ^</dict^> >>"%PLIST%"
+
 :: B-4. IPP TXT values test: The IPP TXT record values match the reported IPP attribute values.
-call :start_test "B-4. IPP TXT values test"
+set /a total+=1
+set <NUL /p="B-4. IPP TXT values test: "
+echo ^<dict^>^<key^>Name^</key^>^<string^>B-4. IPP TXT values test^</string^> >>"%PLIST%"
+echo ^<key^>FileId^</key^>^<string^>org.pwg.ipp-everywhere.20140826.bonjour^</string^> >>"%PLIST%"
+
 set result=FAIL
-ippfind "%1._ipp._tcp.local." --txt-adminurl "^(http:|https:)//" --txt-pdl image/pwg-raster --txt-pdl image/jpeg --txt-rp "^ipp/(print|print/[^/]+)$" --txt-UUID "^[0-9a-fA-F]{8,8}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{12,12}$" -x $IPPTOOL -q -d "ADMINURL={txt_adminurl}" -d "UUID={txt_uuid}" "{}" bonjour-value-tests.test ";" && set result=PASS
+ippfind "%1._ipp._tcp.local." --txt-adminurl ^^^(http:^|https:^)// --txt-pdl image/pwg-raster --txt-pdl image/jpeg --txt-rp ^^ipp/^(print^|print/[^^/]+^)$ --txt-UUID ^^[0-9a-fA-F]{8,8}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{12,12}$ -x ipptool -q -d "ADMINURL={txt_adminurl}" -d "UUID={txt_uuid}" "{}" bonjour-value-tests.test ";" && set result=PASS
 if "%result%" == "PASS" (
        set /a pass+=1
-       call :end_test PASS
 ) else (
        set /a fail+=1
-       ippfind "%1._ipp._tcp.local." -x bonjour-tests.bat "{service_name}" _values ";"
+       echo ^<key^>Errors^</key^>^<array^>^<string^> >>"%PLIST%"
+       ippfind "%1._ipp._tcp.local." -x echo adminurl="{txt_adminurl}" ";" >>"%PLIST%"
+       ippfind "%1._ipp._tcp.local." -x echo pdl="{txt_pdl}" ";" >>"%PLIST%"
+       ippfind "%1._ipp._tcp.local." -x echo rp="{txt_rp}" ";" >>"%PLIST%"
+       ippfind "%1._ipp._tcp.local." -x echo UUID="{txt_uuid}" ";" >>"%PLIST%"
+       ippfind "%1._ipp._tcp.local." -x ipptool -t "{}" bonjour-value-tests.test ";" | findstr /r [TG][EO][DT]: >>"%PLIST%"
+       echo ^</string^>^</array^> >>"%PLIST%"
 )
 
+echo %result%
+if "%result%" == "FAIL" (
+       echo ^<key^>Successful^</key^>^<false /^> >>"%PLIST%"
+
+       ippfind "%1._ipp._tcp.local." -x echo adminurl="{txt_adminurl}" ";"
+       ippfind "%1._ipp._tcp.local." -x echo pdl="{txt_pdl}" ";"
+       ippfind "%1._ipp._tcp.local." -x echo rp="{txt_rp}" ";"
+       ippfind "%1._ipp._tcp.local." -x echo UUID="{txt_uuid}" ";"
+       ippfind "%1._ipp._tcp.local." -x ipptool -t "{}" bonjour-value-tests.test ";" | findstr /r [TG][EO][DT]:
+) else (
+       echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+)
+echo ^</dict^> >>"%PLIST%"
+
 :: B-5. TLS tests: Performed only if TLS is supported
-call :start_test "B-5. TLS tests"
-set result=FAIL
-find "%1._ipp._tcp.local." --txt tls --quiet && set result=PASS
+set /a total+=1
+set <NUL /p="B-5. TLS tests: "
+echo ^<dict^>^<key^>Name^</key^>^<string^>B-5. TLS tests^</string^> >>"%PLIST%"
+echo ^<key^>FileId^</key^>^<string^>org.pwg.ipp-everywhere.20140826.bonjour^</string^> >>"%PLIST%"
+
+set result=SKIP
+ippfind "%1._ipp._tcp.local." --txt tls --quiet && set result=PASS
 if "%result%" == "PASS" (
        set /a pass+=1
        set HAVE_TLS=1
-       call :end_test PASS
 ) else (
        set /a skip+=1
        set HAVE_TLS=0
-       call :end_test SKIP
 )
 
+echo %result%
+if "%result%" == "SKIP" (
+       echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+       echo ^<key^>Skipped^</key^>^<true /^> >>"%PLIST%"
+) else (
+       echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+)
+echo ^</dict^> >>"%PLIST%"
+
 :: B-5.1 HTTP Upgrade test: Printer responds to an IPP Get-Printer-Attributes request after doing an HTTP Upgrade to TLS.
-call :start_test "B-5.1 HTTP Upgrade test"
+set /a total+=1
+set <NUL /p="B-5.1 HTTP Upgrade test: "
+echo ^<dict^>^<key^>Name^</key^>^<string^>B-5.1 HTTP Upgrade test^</string^> >>"%PLIST%"
+echo ^<key^>FileId^</key^>^<string^>org.pwg.ipp-everywhere.20140826.bonjour^</string^> >>"%PLIST%"
+
 if "%HAVE_TLS%" == "1" (
        set result=FAIL
        ippfind "%1._ipp._tcp.local." -x ipptool -E -q "{}" bonjour-access-tests.test ";" && set result=PASS
        if "%result%" == "PASS" (
                set /a pass+=1
-               call :end_test PASS
        ) else (
                set /a fail+=1
-               echo "<key>Errors</key><array><string>" >>"%PLIST"
+               echo ^<key^>Errors^</key^>^<array^>^<string^> >>"%PLIST"
                ippfind "%1._ipp._tcp.local." -x ipptool -E -q "{}" bonjour-access-tests.test ";" >>"%PLIST%"
-               echo "</string></array>" >>"%PLIST%"
-               call :end_test FAIL
+               echo ^</string^>^</array^> >>"%PLIST%"
        )
 ) else (
        set /a skip+=1
-       call :end_test SKIP
+       set result=SKIP
+)
+
+echo %result%
+if "%result%" == "FAIL" (
+       echo ^<key^>Successful^</key^>^<false /^> >>"%PLIST%"
+) else (
+       if "%result%" == "SKIP" (
+               echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+               echo ^<key^>Skipped^</key^>^<true /^> >>"%PLIST%"
+       ) else (
+               echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+       )
 )
+echo ^</dict^> >>"%PLIST%"
 
 :: B-5.2 IPPS Browse test: Printer appears in a search for "_ipps._tcp,_print" services.
-call :start_test "B-5.2 IPPS Browse test"
+set /a total+=1
+set <NUL /p="B-5.2 IPPS Browse test: "
+echo ^<dict^>^<key^>Name^</key^>^<string^>B-5.2 IPPS Browse test^</string^> >>"%PLIST%"
+echo ^<key^>FileId^</key^>^<string^>org.pwg.ipp-everywhere.20140826.bonjour^</string^> >>"%PLIST%"
+
 if "%HAVE_TLS%" == "1" (
        set result=FAIL
        ippfind _ipps._tcp,_print.local. --name "%1" --quiet && set result=PASS
        if "%result%" == "PASS" (
                set /a pass+=1
-               call :end_test PASS
        ) else (
                set /a fail+=1
-               call :end_test FAIL
        )
 ) else (
        set /a skip+=1
-       call :end_test SKIP
+       set result=SKIP
 )
 
+echo %result%
+if "%result%" == "FAIL" (
+       echo ^<key^>Successful^</key^>^<false /^> >>"%PLIST%"
+) else (
+       if "%result%" == "SKIP" (
+               echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+               echo ^<key^>Skipped^</key^>^<true /^> >>"%PLIST%"
+       ) else (
+               echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+       )
+)
+echo ^</dict^> >>"%PLIST%"
+
 :: B-5.3 IPPS TXT keys test: The TXT record for IPPS contains all required keys
-call :start_test "B-5.3 IPPS TXT keys test"
+set /a total+=1
+set <NUL /p="B-5.3 IPPS TXT keys test: "
+echo ^<dict^>^<key^>Name^</key^>^<string^>B-5.3 IPPS TXT keys test^</string^> >>"%PLIST%"
+echo ^<key^>FileId^</key^>^<string^>org.pwg.ipp-everywhere.20140826.bonjour^</string^> >>"%PLIST%"
+
 if "%HAVE_TLS%" == "1" (
        set result=FAIL
        ippfind "%1._ipps._tcp.local." --txt adminurl --txt pdl --txt rp --txt TLS --txt UUID --quiet && set result=PASS
        if "%result%" == "PASS" (
                set /a pass+=1
-               call :end_test PASS
        ) else (
                set /a fail+=1
-               ippfind "%1._ipps._tcp.local." -x bonjour-tests.bat "{service_name}" _keys ";"
+               echo ^<key^>Errors^</key^>^<array^>^<string^> >>"%PLIST%"
+               ippfind "%1._ipps._tcp.local." -x echo adminurl={txt_adminurl}" ";" >>"%PLIST%"
+               ippfind "%1._ipps._tcp.local." -x echo pdl={txt_pdl}" ";" >>"%PLIST%"
+               ippfind "%1._ipps._tcp.local." -x echo rp={txt_rp}" ";" >>"%PLIST%"
+               ippfind "%1._ipps._tcp.local." -x echo TLS={txt_tls}" ";" >>"%PLIST%"
+               ippfind "%1._ipps._tcp.local." -x echo UUID={txt_uuid}" ";" >>"%PLIST%"
+               echo ^</string^>^</array^> >>"%PLIST%"
        )
 ) else (
        set /a skip+=1
-       call :end_test SKIP
+       set result=SKIP
 )
 
+echo %result%
+if "%result%" == "FAIL" (
+       echo ^<key^>Successful^</key^>^<false /^> >>"%PLIST%"
+
+        ippfind "%1._ipps._tcp.local." -x echo     adminurl={txt_adminurl}" ";"
+        ippfind "%1._ipps._tcp.local." -x echo     pdl={txt_pdl}" ";"
+        ippfind "%1._ipps._tcp.local." -x echo     rp={txt_rp}" ";"
+        ippfind "%1._ipps._tcp.local." -x echo     TLS={txt_tls}" ";"
+        ippfind "%1._ipps._tcp.local." -x echo     UUID={txt_uuid}" ";"
+) else (
+       if "%result%" == "SKIP" (
+               echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+               echo ^<key^>Skipped^</key^>^<true /^> >>"%PLIST%"
+       ) else (
+               echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+       )
+)
+echo ^</dict^> >>"%PLIST%"
+
 :: B-5.4 IPPS Resolve test: Printer responds to an IPPS Get-Printer-Attributes request using the resolved hostname, port, and resource path.
-call :start_test "B-5.4 IPPS Resolve test"
+set /a total+=1
+set <NUL /p="B-5.4 IPPS Resolve test: "
+echo ^<dict^>^<key^>Name^</key^>^<string^>B-5.4 IPPS Resolve test^</string^> >>"%PLIST%"
+echo ^<key^>FileId^</key^>^<string^>org.pwg.ipp-everywhere.20140826.bonjour^</string^> >>"%PLIST%"
+
 if "%HAVE_TLS%" == "1" (
        set result=FAIL
        (ippfind "%1._ipps._tcp.local." --ls && set result=PASS) >nul:
        if "%result%" == "PASS" (
                set /a pass+=1
-               call :end_test PASS
        ) else (
                set /a fail+=1
-               echo "<key>Errors</key><array><string>" >>"%PLIST%"
+               echo ^<key^>Errors^</key^>^<array^>^<string^> >>"%PLIST%"
                ippfind "%1._ipps._tcp.local." --ls >>"%PLIST%"
-               echo "</string></array>" >>"%PLIST%"
-               call :end_test FAIL
+               echo ^</string^>^</array^> >>"%PLIST%"
        )
 ) else (
        set /a skip+=1
-       call :end_test SKIP
+       set result=SKIP
+)
+
+echo %result%
+if "%result%" == "FAIL" (
+       echo ^<key^>Successful^</key^>^<false /^> >>"%PLIST%"
+) else (
+       if "%result%" == "SKIP" (
+               echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+               echo ^<key^>Skipped^</key^>^<true /^> >>"%PLIST%"
+       ) else (
+               echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+       )
 )
+echo ^</dict^> >>"%PLIST%"
 
 :: B-5.5 IPPS TXT values test: The TXT record values for IPPS match the reported IPPS attribute values.
-call :start_test "B-5.5 IPPS TXT values test"
+set /a total+=1
+set <NUL /p="B-5.5 IPPS TXT values test: "
+echo ^<dict^>^<key^>Name^</key^>^<string^>B-5.5 IPPS TXT values test^</string^> >>"%PLIST%"
+echo ^<key^>FileId^</key^>^<string^>org.pwg.ipp-everywhere.20140826.bonjour^</string^> >>"%PLIST%"
+
 if "%HAVE_TLS%" == "1" (
        set result=FAIL
-       ippfind "%1._ipps._tcp.local." --txt-adminurl "^(http:|https:)//" --txt-pdl image/pwg-raster --txt-pdl image/jpeg --txt-rp "^ipp/(print|print/[^/]+)$" --txt-UUID "^[0-9a-fA-F]{8,8}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{12,12}$" -x ipptool -q -d "ADMINURL={txt_adminurl}" -d "UUID={txt_uuid}" "{}" bonjour-value-tests.test ";" && set result=PASS
+       ippfind "%1._ipps._tcp.local." --txt-adminurl ^^^(http:^|https:^)// --txt-pdl image/pwg-raster --txt-pdl image/jpeg --txt-rp ^^ipp/^(print^|print/[^^/]+^)$ --txt-UUID ^^[0-9a-fA-F]{8,8}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{4,4}-[0-9a-fA-F]{12,12}$ -x ipptool -q "{}" bonjour-value-tests.test ";" && set result=PASS
        if "%result%" == "PASS" (
                set /a pass+=1
-               call :end_test PASS
        ) else (
                set /a fail+=1
-               ippfind "%1._ipps._tcp.local." -x bonjour-tests.bat "{service_name}" _values ";"
+               echo ^<key^>Errors^</key^>^<array^>^<string^> >>"%PLIST%"
+               ippfind "%1._ipps._tcp.local." -x echo adminurl="{txt_adminurl}" ";" >>"%PLIST%"
+               ippfind "%1._ipps._tcp.local." -x echo pdl="{txt_pdl}" ";" >>"%PLIST%"
+               ippfind "%1._ipps._tcp.local." -x echo rp="{txt_rp}" ";" >>"%PLIST%"
+               ippfind "%1._ipps._tcp.local." -x echo TLS="{txt_tls}" ";" >>"%PLIST%"
+               ippfind "%1._ipps._tcp.local." -x echo UUID="{txt_uuid}" ";" >>"%PLIST%"
+               ippfind "%1._ipps._tcp.local." -x ipptool -t "{}" bonjour-value-tests.test ";" | findstr /r [TG][EO][DT]: >>"%PLIST"
+               echo ^</string^>^</array^> >>"%PLIST%"
        )
 ) else (
        set /a skip+=1
-       call :end_test SKIP
+       set result=SKIP
 )
 
+echo %result%
+if "%result%" == "FAIL" (
+       echo ^<key^>Successful^</key^>^<false /^> >>"%PLIST%"
+
+        ippfind "%1._ipps._tcp.local." -x echo adminurl="{txt_adminurl}" ";"
+        ippfind "%1._ipps._tcp.local." -x echo pdl="{txt_pdl}" ";"
+        ippfind "%1._ipps._tcp.local." -x echo rp="{txt_rp}" ";"
+        ippfind "%1._ipps._tcp.local." -x echo TLS="{txt_tls}" ";"
+        ippfind "%1._ipps._tcp.local." -x echo UUID="{txt_uuid}" ";"
+       ippfind "%1._ipp._tcp.local." -x ipptool -t "{}" bonjour-value-tests.test ";" | findstr /r [TG][EO][DT]:
+) else (
+       if "%result%" == "SKIP" (
+               echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+               echo ^<key^>Skipped^</key^>^<true /^> >>"%PLIST%"
+       ) else (
+               echo ^<key^>Successful^</key^>^<true /^> >>"%PLIST%"
+       )
+)
+echo ^</dict^> >>"%PLIST%"
+
 :: Finish up...
-echo "</array>" >>"%PLIST%"
-echo "<key>Successful</key>" >>"%PLIST%"
+echo ^</array^> >>"%PLIST%"
+echo ^<key^>Successful^</key^> >>"%PLIST%"
 if %fail% gtr 0 (
-       echo "<false />" >>"%PLIST%"
+       echo ^<false /^> >>"%PLIST%"
 ) else (
-       echo "<true />" >>"%PLIST%"
+       echo ^<true /^> >>"%PLIST%"
 )
-echo "</dict>" >>"%PLIST%"
-echo "</plist>" >>"%PLIST%"
+echo ^</dict^> >>"%PLIST%"
+echo ^</plist^> >>"%PLIST%"
 
 set /a score=%pass% + %skip%
 set /a score=100 * %score% / %total%
-echo "Summary: %total% tests, %pass% passed, %fail% failed, %skip% skipped"
-echo "Score: %score%^%"
-
-exit
-
-:: call :start_test "name"
-:start_test
-       set /a total+=1
-       setlocal
-       set name=%1
-       set name=%name:~1,-1%
-       set <NUL /p="%name%: "
-       echo "<dict><key>Name</key><string>%name%</string>" >>"%PLIST%"
-       echo "<key>FileId</key><string>org.pwg.ipp-everywhere.20140826.bonjour</string>" >>"%PLIST%"
-       endlocal
-       goto :eof
-
-:: call :end_test PASS/FAIL/SKIP
-:end_test
-       setlocal
-       echo %1
-       if "%1" == "FAIL" (
-               echo "<key>Successful</key><false />" >>"%PLIST%"
-       ) else (
-               if "%1" == "SKIP" (
-                       echo "<key>Successful</key><true />" >>"%PLIST%"
-                       echo "<key>Skipped</key><true />" >>"%PLIST%"
-               ) else (
-                       echo "<key>Successful</key><true />" >>"%PLIST%"
-               )
-       )
-       echo "</dict>" >>"%PLIST%"
-       endlocal
-       goto :eof
+echo Summary: %total% tests, %pass% passed, %fail% failed, %skip% skipped
+echo Score: %score%%%
 
 ::
 :: End of "$Id$".
index a7fce325799cd802f3793e1d87fb1430917f69be..71d9c41ee73fe04ebefb67039bb5964a07785e68 100644 (file)
@@ -15,7 +15,8 @@
 #
 # Usage:
 #
-#   ./ipptool -tI printer-uri -d ADMINURL=url -d UUID=uuid bonjour-value-tests.test
+#   (run from within ippfind)
+#   ippfind ... -x ipptool -t "{}" bonjour-value-tests.test ";"
 #
 
 FILE-ID "org.pwg.ipp-everywhere.20140826.bonjour"
@@ -37,8 +38,8 @@ FILE-ID "org.pwg.ipp-everywhere.20140826.bonjour"
        STATUS successful-ok
 
        # What attributes do we expect?
-       EXPECT printer-more-info OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "$ADMINURL"
-       EXPECT printer-uuid OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "urn:uuid:$UUID"
+       EXPECT printer-more-info OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "$ENV[IPPFIND_TXT_ADMINURL]"
+       EXPECT printer-uuid OF-TYPE uri IN-GROUP printer-attributes-tag COUNT 1 WITH-VALUE "urn:uuid:$ENV[IPPFIND_TXT_UUID]"
 }
 
 #
index db9eaf02ba3ec67bda6e0796bf04eea77ff850ee..ca9f1a7205577f26418a3f97bd36570c2c714415 100644 (file)
@@ -3221,7 +3221,7 @@ do_tests(FILE         *outfile,           /* I - Output file */
        }
       }
     }
-    else if (!prev_pass)
+    else if (!prev_pass && Output != _CUPS_OUTPUT_QUIET)
       fprintf(stderr, "%s\n", cupsLastErrorString());
 
     if (prev_pass && Output >= _CUPS_OUTPUT_LIST && !Verbosity &&