.\"
-.\" "$Id: cupstestppd.man,v 1.2 2002/12/17 18:59:56 swdev Exp $"
+.\" "$Id: cupstestppd.man,v 1.3 2003/01/24 21:32:13 mike Exp $"
.\"
.\" cupstestppd man page for the Common UNIX Printing System (CUPS).
.\"
cupstestppd \- test conformance of ppd files
.SH SYNOPSIS
.B cupstestppd
-[ -v ] filename.ppd [ ... filenameN.ppd ]
+[ -q ] [ -v ] filename.ppd [ ... filenameN.ppd ]
.br
.B cupstestppd
-[ -v ] -
+[ -q ] [ -v ] -
.SH DESCRIPTION
\fIcupstestppd\fR tests the conformance of PPD files to the
Adobe PostScript Printer Description file format specification
on the standard input. The second form can be used to test
compressed PPD files using the appropriate utility.
.LP
+The \fI-q\fR option specifies that no information should be displayed.
+.LP
The \fI-v\fR option specifies that all information in the PPD file
should be displayed in addition to the conformance testing results.
+.LP
+The \fI-q\fR and \fI-v\fR options are mutually exclusive.
.SH EXIT STATUS
\fIcupstestppd\fR returns zero on success and non-zero on error. The
error codes are as follows:
4
.br
The PPD file does not conform to the Adobe PPD specification.
+.SH EXAMPLES
+The following command will test all PPD files in the current directory
+and print the names of each file that does not conform:
+.nf
+
+ find . -name \\*.ppd -exec cupstestppd -q '{}' \\; -print
+
+.fi
.SH SEE ALSO
CUPS Software Administrators Manual,
CUPS Software Programmers Manual,
.SH COPYRIGHT
Copyright 1993-2003 by Easy Software Products, All Rights Reserved.
.\"
-.\" End of "$Id: cupstestppd.man,v 1.2 2002/12/17 18:59:56 swdev Exp $".
+.\" End of "$Id: cupstestppd.man,v 1.3 2003/01/24 21:32:13 mike Exp $".
.\"
/*
- * "$Id: cupstestppd.c,v 1.2 2002/12/17 19:00:20 swdev Exp $"
+ * "$Id: cupstestppd.c,v 1.3 2003/01/24 21:32:14 mike Exp $"
*
* PPD test program for the Common UNIX Printing System (CUPS).
*
status = ERROR_NONE;
for (i = 1; i < argc; i ++)
- if (strcmp(argv[i], "-v") == 0)
+ if (strcmp(argv[i], "-q") == 0)
+ {
+ if (verbose > 0)
+ {
+ fputs("cupstestppd: The -q option is incompatible with the -v option.\n",
+ stderr);
+ return (1);
+ }
+
+ verbose --;
+ }
+ else if (strcmp(argv[i], "-v") == 0)
+ {
+ if (verbose < 0)
+ {
+ fputs("cupstestppd: The -v option is incompatible with the -q option.\n",
+ stderr);
+ return (1);
+ }
+
verbose ++;
+ }
else if (argv[i][0] == '-' && argv[i][1])
{
ppd = NULL;
* Read from stdin...
*/
- puts("FILE: (stdin)\n");
+ if (verbose >= 0)
+ puts("FILE: (stdin)\n");
ppd = ppdOpen(stdin);
}
* Read from a file...
*/
- printf("FILE: %s\n\n", argv[i]);
+ if (verbose >= 0)
+ printf("FILE: %s\n\n", argv[i]);
ppd = ppdOpenFile(argv[i]);
}
if (errno)
{
status = ERROR_FILE_OPEN;
- printf(" Unable to open PPD file - %s\n\n", strerror(errno));
+
+ if (verbose >= 0)
+ printf(" Unable to open PPD file - %s\n\n", strerror(errno));
}
else
{
status = ERROR_PPD_FORMAT;
- puts(" Unable to open PPD file using CUPS functions!\n");
+
+ if (verbose >= 0)
+ puts(" Unable to open PPD file using CUPS functions!\n");
}
continue;
* only by what the CUPS PPD functions actually load...)
*/
- puts(" CONFORMANCE TESTS:");
+ if (verbose >= 0)
+ puts(" CONFORMANCE TESTS:");
errors = 0;
for (k = 0, option = group->options; k < group->num_options; k ++, option ++)
if (option->defchoice[0])
{
- printf(" PASS Default%s\n", option->keyword);
+ if (verbose >= 0)
+ printf(" PASS Default%s\n", option->keyword);
}
else
{
errors ++;
- printf(" **FAIL** REQUIRED Default%s\n", option->keyword);
+
+ if (verbose >= 0)
+ printf(" **FAIL** REQUIRED Default%s\n", option->keyword);
}
if (ppd->num_fonts)
- puts(" PASS Fonts");
+ {
+ if (verbose >= 0)
+ puts(" PASS Fonts");
+ }
else
{
errors ++;
- puts(" **FAIL** REQUIRED Fonts");
+
+ if (verbose >= 0)
+ puts(" **FAIL** REQUIRED Fonts");
}
if (ppd->lang_encoding != NULL)
- puts(" PASS LanguageEncoding");
+ {
+ if (verbose >= 0)
+ puts(" PASS LanguageEncoding");
+ }
else
{
errors ++;
- puts(" **FAIL** REQUIRED LanguageEncoding");
+
+ if (verbose >= 0)
+ puts(" **FAIL** REQUIRED LanguageEncoding");
}
if (ppd->lang_version != NULL)
- puts(" PASS LanguageVersion");
+ {
+ if (verbose >= 0)
+ puts(" PASS LanguageVersion");
+ }
else
{
errors ++;
- puts(" **FAIL** REQUIRED LanguageVersion");
+
+ if (verbose >= 0)
+ puts(" **FAIL** REQUIRED LanguageVersion");
}
if (ppd->manufacturer != NULL)
- puts(" PASS Manufacturer");
+ {
+ if (verbose >= 0)
+ puts(" PASS Manufacturer");
+ }
else
{
errors ++;
- puts(" **FAIL** REQUIRED Manufacturer");
+
+ if (verbose >= 0)
+ puts(" **FAIL** REQUIRED Manufacturer");
}
if (ppd->modelname != NULL)
- puts(" PASS ModelName");
+ {
+ if (verbose >= 0)
+ puts(" PASS ModelName");
+ }
else
{
errors ++;
- puts(" **FAIL** REQUIRED ModelName");
+
+ if (verbose >= 0)
+ puts(" **FAIL** REQUIRED ModelName");
}
if (ppd->nickname != NULL)
- puts(" PASS NickName");
+ {
+ if (verbose >= 0)
+ puts(" PASS NickName");
+ }
else
{
errors ++;
- puts(" **FAIL** REQUIRED NickName");
+
+ if (verbose >= 0)
+ puts(" **FAIL** REQUIRED NickName");
}
if (ppdFindOption(ppd, "PageSize") != NULL)
- puts(" PASS PageSize");
+ {
+ if (verbose >= 0)
+ puts(" PASS PageSize");
+ }
else
{
errors ++;
- puts(" **FAIL** REQUIRED PageSize");
+
+ if (verbose >= 0)
+ puts(" **FAIL** REQUIRED PageSize");
}
if (ppdFindOption(ppd, "PageRegion") != NULL)
- puts(" PASS PageRegion");
+ {
+ if (verbose >= 0)
+ puts(" PASS PageRegion");
+ }
else
{
errors ++;
- puts(" **FAIL** REQUIRED PageRegion");
+
+ if (verbose >= 0)
+ puts(" **FAIL** REQUIRED PageRegion");
}
if (ppd->product != NULL)
- puts(" PASS Product");
+ {
+ if (verbose >= 0)
+ puts(" PASS Product");
+ }
else
{
errors ++;
- puts(" **FAIL** REQUIRED Product");
+
+ if (verbose >= 0)
+ puts(" **FAIL** REQUIRED Product");
}
if (ppd->shortnickname != NULL)
- puts(" PASS ShortNickName");
+ {
+ if (verbose >= 0)
+ puts(" PASS ShortNickName");
+ }
else
{
errors ++;
- puts(" **FAIL** REQUIRED ShortNickName");
+
+ if (verbose >= 0)
+ puts(" **FAIL** REQUIRED ShortNickName");
}
if (errors)
{
- puts("\n **** CONFORMANCE TESTING FAILED ****");
+ if (verbose >= 0)
+ puts("\n **** CONFORMANCE TESTING FAILED ****");
+
status = ERROR_CONFORMANCE;
}
- puts("");
+ if (verbose >= 0)
+ puts("");
/*
* Then list the options, if "-v" was provided...
*/
- if (verbose)
+ if (verbose > 0)
{
puts("");
puts(" OPTIONS:");
if (!ppd)
{
- puts("Usage: cupstestppd [-v] filename1.ppd [... filenameN.ppd]");
- puts(" program | cupstestppd [-v] -");
+ puts("Usage: cupstestppd [-q] [-v] filename1.ppd [... filenameN.ppd]");
+ puts(" program | cupstestppd [-q] [-v] -");
return (ERROR_USAGE);
}
/*
- * End of "$Id: cupstestppd.c,v 1.2 2002/12/17 19:00:20 swdev Exp $".
+ * End of "$Id: cupstestppd.c,v 1.3 2003/01/24 21:32:14 mike Exp $".
*/