/*
- * "$Id$"
+ * "$Id: ipptest.c 5878 2006-08-24 15:55:42Z mike $"
*
* IPP test command for the Common UNIX Printing System (CUPS).
*
int status; /* Status of tests... */
const char *uri; /* URI to use */
const char *testfile; /* Test file to use */
+ int interval; /* Test interval */
/*
uri = NULL;
testfile = NULL;
status = 0;
+ interval = 0;
for (i = 1; i < argc; i ++)
{
{
if (!strcmp(argv[i], "-v"))
Verbosity ++;
+ else if (!strcmp(argv[i], "-i"))
+ {
+ i++;
+
+ if (i >= argc)
+ usage(NULL);
+ else
+ interval = atoi(argv[i]);
+ }
else
usage(argv[i]);
}
if (!uri || !testfile)
usage(NULL);
+ /*
+ * Loop if the interval is set...
+ */
+
+ if (interval)
+ {
+ for (;;)
+ {
+ sleep(interval);
+ do_tests(uri, testfile);
+ }
+ }
+
/*
* Exit...
*/
return;
}
- printf(" %s (%s) = ", attr->name, get_tag_string(attr->value_tag));
+ printf(" %s (%s%s) = ", attr->name,
+ attr->num_values > 1 ? "1setOf " : "",
+ get_tag_string(attr->value_tag));
switch (attr->value_tag)
{
fputs("Usage: ipptest [options] URL testfile [ ... testfileN ]\n", stderr);
fputs("Options:\n", stderr);
fputs("\n", stderr);
- fputs("-v Show all attributes in response, even on success.\n", stderr);
+ fputs("-i N Repeat the last test file once every N seconds.\n", stderr);
+ fputs("-v Show all attributes in response, even on success.\n", stderr);
exit(1);
}
/*
- * End of "$Id$".
+ * End of "$Id: ipptest.c 5878 2006-08-24 15:55:42Z mike $".
*/