| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 Google Inc. | 2 * Copyright 2011 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 /* | 8 /* |
| 9 * Code for the "gm" (Golden Master) rendering comparison tool. | 9 * Code for the "gm" (Golden Master) rendering comparison tool. |
| 10 * | 10 * |
| (...skipping 1407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 "use the default. 0 for either disables the cache."); | 1418 "use the default. 0 for either disables the cache."); |
| 1419 #endif | 1419 #endif |
| 1420 DEFINE_bool(hierarchy, false, "Whether to use multilevel directory structure " | 1420 DEFINE_bool(hierarchy, false, "Whether to use multilevel directory structure " |
| 1421 "when reading/writing files."); | 1421 "when reading/writing files."); |
| 1422 DEFINE_string(ignoreErrorTypes, kDefaultIgnorableErrorTypes.asString(" ").c_str(
), | 1422 DEFINE_string(ignoreErrorTypes, kDefaultIgnorableErrorTypes.asString(" ").c_str(
), |
| 1423 "Space-separated list of ErrorTypes that should be ignored. If any
*other* error " | 1423 "Space-separated list of ErrorTypes that should be ignored. If any
*other* error " |
| 1424 "types are encountered, the tool will exit with a nonzero return v
alue."); | 1424 "types are encountered, the tool will exit with a nonzero return v
alue."); |
| 1425 DEFINE_string(ignoreFailuresFile, "", "Path to file containing a list of tests f
or which we " | 1425 DEFINE_string(ignoreFailuresFile, "", "Path to file containing a list of tests f
or which we " |
| 1426 "should ignore failures.\n" | 1426 "should ignore failures.\n" |
| 1427 "The file should list one test per line, except for comment lines
starting with #"); | 1427 "The file should list one test per line, except for comment lines
starting with #"); |
| 1428 DEFINE_string(ignoreTests, "", "Space delimited list of tests for which we shoul
d ignore " | |
| 1429 "failures.\n" | |
| 1430 "DEPRECATED in favor of --ignoreFailuresFile; see bug 1730"); | |
| 1431 DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n" | 1428 DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n" |
| 1432 "Multiple matches may be separated by spaces.\n" | 1429 "Multiple matches may be separated by spaces.\n" |
| 1433 "~ causes a matching test to always be skipped\n" | 1430 "~ causes a matching test to always be skipped\n" |
| 1434 "^ requires the start of the test to match\n" | 1431 "^ requires the start of the test to match\n" |
| 1435 "$ requires the end of the test to match\n" | 1432 "$ requires the end of the test to match\n" |
| 1436 "^ and $ requires an exact match\n" | 1433 "^ and $ requires an exact match\n" |
| 1437 "If a test does not match any list entry,\n" | 1434 "If a test does not match any list entry,\n" |
| 1438 "it is skipped unless some list entry starts with ~"); | 1435 "it is skipped unless some list entry starts with ~"); |
| 1439 DEFINE_string(missingExpectationsPath, "", "Write images for tests without expec
tations " | 1436 DEFINE_string(missingExpectationsPath, "", "Write images for tests without expec
tations " |
| 1440 "into this directory."); | 1437 "into this directory."); |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2055 return true; | 2052 return true; |
| 2056 } | 2053 } |
| 2057 | 2054 |
| 2058 /** | 2055 /** |
| 2059 * Replace contents of ignoreTestSubstrings with a list of testname/config subst
rings, indicating | 2056 * Replace contents of ignoreTestSubstrings with a list of testname/config subst
rings, indicating |
| 2060 * which tests' failures should be ignored. | 2057 * which tests' failures should be ignored. |
| 2061 */ | 2058 */ |
| 2062 static bool parse_flags_ignore_tests(SkTArray<SkString> &ignoreTestSubstrings) { | 2059 static bool parse_flags_ignore_tests(SkTArray<SkString> &ignoreTestSubstrings) { |
| 2063 ignoreTestSubstrings.reset(); | 2060 ignoreTestSubstrings.reset(); |
| 2064 | 2061 |
| 2065 // Parse --ignoreTests | |
| 2066 if (FLAGS_ignoreTests.count() > 0) { | |
| 2067 gm_fprintf(stderr, "you are using deprecated --ignoreTests flag\n"); | |
| 2068 for (int i = 0; i < FLAGS_ignoreTests.count(); i++) { | |
| 2069 ignoreTestSubstrings.push_back(SkString(FLAGS_ignoreTests[i])); | |
| 2070 } | |
| 2071 } | |
| 2072 | |
| 2073 // Parse --ignoreFailuresFile | 2062 // Parse --ignoreFailuresFile |
| 2074 for (int i = 0; i < FLAGS_ignoreFailuresFile.count(); i++) { | 2063 for (int i = 0; i < FLAGS_ignoreFailuresFile.count(); i++) { |
| 2075 SkTArray<SkString> linesFromFile; | 2064 SkTArray<SkString> linesFromFile; |
| 2076 if (!read_lines_from_file(FLAGS_ignoreFailuresFile[i], linesFromFile)) { | 2065 if (!read_lines_from_file(FLAGS_ignoreFailuresFile[i], linesFromFile)) { |
| 2077 return false; | 2066 return false; |
| 2078 } else { | 2067 } else { |
| 2079 for (int j = 0; j < linesFromFile.count(); j++) { | 2068 for (int j = 0; j < linesFromFile.count(); j++) { |
| 2080 SkString thisLine = linesFromFile[j]; | 2069 SkString thisLine = linesFromFile[j]; |
| 2081 if (thisLine.isEmpty() || thisLine.startsWith('#')) { | 2070 if (thisLine.isEmpty() || thisLine.startsWith('#')) { |
| 2082 // skip this line | 2071 // skip this line |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2386 if (FLAGS_forceBWtext) { | 2375 if (FLAGS_forceBWtext) { |
| 2387 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); | 2376 canvas->setDrawFilter(SkNEW(BWTextDrawFilter))->unref(); |
| 2388 } | 2377 } |
| 2389 } | 2378 } |
| 2390 | 2379 |
| 2391 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 2380 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 2392 int main(int argc, char * const argv[]) { | 2381 int main(int argc, char * const argv[]) { |
| 2393 return tool_main(argc, (char**) argv); | 2382 return tool_main(argc, (char**) argv); |
| 2394 } | 2383 } |
| 2395 #endif | 2384 #endif |
| OLD | NEW |