2 * Copyright 2008, Haiku.
3 * Distributed under the terms of the MIT license.
6 * Michael Pfeiffer <laplace@users.sourceforge.net>
16 void TestPPDParser(bool all
, bool verbose
= true);
19 const char* gPPDFile
= "aptollw1.ppd";
23 bool enabled(const char* name
, const char* arg
)
25 gArgs
.AddItem((void*)name
);
26 if (arg
== NULL
) return false;
27 if (strcmp(arg
, "all") == 0) return true;
28 return strcmp(arg
, name
) == 0;
31 void printArgs(const char* programName
)
33 fprintf(stderr
, "%s: argument\n", programName
);
34 fprintf(stderr
, "Argument is missing. The available arguments are:\n");
35 fprintf(stderr
, " all\n");
36 for (int i
= 0; i
< gArgs
.CountItems(); i
++) {
37 fprintf(stderr
, " %s\n", (const char*)gArgs
.ItemAt(i
));
41 int main(int argc
, char* argv
[])
43 const char* arg
= argc
>= 2 ? argv
[1] : NULL
;
49 if (enabled("scanner", arg
)) {
52 if (enabled("parser", arg
)) {
55 if (enabled("ppd", arg
)) {
58 if (enabled("header", arg
)) {
61 if (enabled("ui", arg
)) {
64 if (enabled("ppd-timing", arg
)) {
65 TestPPDParser(true, false);
67 if (enabled("header-timing", arg
)) {
68 TestPPDParser(false, false);