70// We only support -v or --pixel-tests or --stdout or --stderr or -, all the others will be
71// pass as test case name (even -abc.html is a valid test case name)
72bool isOption(const QString& str)
73{
74 return str == QString("-v") || str == QString("--pixel-tests")
75 || str == QString("--stdout") || str == QString("--stderr")
76 || str == QString("-");
77}
78
79// Get the option value and remove the option and value from arguments list
80QString takeOptionValue(QStringList& arguments, int index)
81{
82 QString result;
83
84 if (index + 1 < arguments.count() && !isOption(arguments.at(index + 1)))
85 result = arguments.takeAt(index + 1);
86 arguments.removeAt(index);
87
88 return result;
89}
90
91void printUsage()
92{
93 fprintf(stderr, "Usage: DumpRenderTree [-v|--pixel-tests] [-o output_filename] [-e error_filename] filename [filename2..n]\n");
94 fprintf(stderr, "Or folder containing test files: DumpRenderTree [-v|--pixel-tests] dirpath\n");
95 fflush(stderr);
96}
97