#
# Example files makefile for CUPS.
#
+# Copyright © 2021 by OpenPrinting.
# Copyright © 2007-2019 by Apple Inc.
# Copyright © 2002-2005 by Easy Software Products.
#
ipp-2.2.test \
ipp-backend.test \
ipp-everywhere.test \
+ print-job.test \
print-job-and-wait.test \
print-job-deflate.test \
print-job-gzip.test \
print-job-letter.test \
print-job-manual.test \
print-job-media-col.test \
+ print-job-media-needed.test \
print-job-password.test \
- print-job.test \
print-uri.test \
set-attrs-hold.test \
validate-job.test
--- /dev/null
+# Print a test page, expecting the printer to run out of media
+{
+ PAUSE "Remove Paper"
+
+ NAME "Print file expecting media-empty"
+ OPERATION Print-Job
+ GROUP operation-attributes-tag
+ ATTR charset attributes-charset utf-8
+ ATTR language attributes-natural-language en
+ ATTR uri printer-uri $uri
+ ATTR name requesting-user-name $user
+ ATTR mimeMediaType document-format $filetype
+ FILE $filename
+ STATUS successful-ok
+
+ MONITOR-PRINTER-STATE $uri {
+ EXPECT printer-state-reasons WITH-VALUE "/^media-needed/" DEFINE-MATCH HAVE_MEDIA_NEEDED
+ }
+}
+
+{
+ PASS-IF-DEFINED HAVE_MEDIA_NEEDED
+
+ NAME "Wait for media-empty"
+ OPERATION Get-Printer-Attributes
+ GROUP operation-attributes-tag
+ ATTR charset attributes-charset utf-8
+ ATTR language attributes-natural-language en
+ ATTR uri printer-uri $uri
+ ATTR name requesting-user-name $user
+ ATTR keyword requested-attributes printer-state-reasons
+ STATUS successful-ok
+ EXPECT printer-state-reasons WITH-VALUE "/^media-needed/" REPEAT-NO-MATCH
+}
+
+{
+ PAUSE "Load Paper"
+
+ NAME "Wait for no media-empty"
+ OPERATION Get-Printer-Attributes
+ GROUP operation-attributes-tag
+ ATTR charset attributes-charset utf-8
+ ATTR language attributes-natural-language en
+ ATTR uri printer-uri $uri
+ ATTR name requesting-user-name $user
+ ATTR keyword requested-attributes printer-state-reasons
+ STATUS successful-ok
+ EXPECT printer-state-reasons WITH-VALUE "/^media-needed/" REPEAT-MATCH
+}
if (strcmp(temp, "{"))
{
// Got a printer URI so copy it...
- data->monitor_uri = strdup(temp);
+ _ippVarsExpand(data->vars, value, temp, sizeof(value));
+ data->monitor_uri = strdup(value);
// Then see if we have an opening brace...
if (!_ippFileReadToken(f, temp, sizeof(temp)) || strcmp(temp, "{"))