OLD | NEW |
1 // Main binary for DM. | 1 // Main binary for DM. |
2 // For a high-level overview, please see dm/README. | 2 // For a high-level overview, please see dm/README. |
3 | 3 |
4 #include "SkBenchmark.h" | 4 #include "SkBenchmark.h" |
5 #include "SkCommandLineFlags.h" | 5 #include "SkCommandLineFlags.h" |
6 #include "SkForceLinking.h" | 6 #include "SkForceLinking.h" |
7 #include "SkGraphics.h" | 7 #include "SkGraphics.h" |
8 #include "SkPicture.h" | 8 #include "SkPicture.h" |
9 #include "SkString.h" | 9 #include "SkString.h" |
10 #include "Test.h" | 10 #include "Test.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 DEFINE_string(match, "", "[~][^]substring[$] [...] of GM name to run.\n" | 44 DEFINE_string(match, "", "[~][^]substring[$] [...] of GM name to run.\n" |
45 "Multiple matches may be separated by spaces.\n" | 45 "Multiple matches may be separated by spaces.\n" |
46 "~ causes a matching GM to always be skipped\n" | 46 "~ causes a matching GM to always be skipped\n" |
47 "^ requires the start of the GM to match\n" | 47 "^ requires the start of the GM to match\n" |
48 "$ requires the end of the GM to match\n" | 48 "$ requires the end of the GM to match\n" |
49 "^ and $ requires an exact match\n" | 49 "^ and $ requires an exact match\n" |
50 "If a GM does not match any list entry,\n" | 50 "If a GM does not match any list entry,\n" |
51 "it is skipped unless some list entry starts with ~"); | 51 "it is skipped unless some list entry starts with ~"); |
52 DEFINE_string(config, "565 8888 gpu nonrendering", | 52 DEFINE_string(config, "565 8888 gpu nonrendering", |
53 "Options: 565 8888 gpu nonrendering msaa4 msaa16 nvprmsaa4 nvprmsa
a16 gpunull gpudebug angle mesa"); | 53 "Options: 565 8888 gpu nonrendering msaa4 msaa16 nvprmsaa4 nvprmsa
a16 gpunull gpudebug angle mesa"); |
| 54 DEFINE_bool(dryRun, false, "Just print the tests that would be run, without actu
ally running them."); |
54 DEFINE_bool(leaks, false, "Print leaked instance-counted objects at exit?"); | 55 DEFINE_bool(leaks, false, "Print leaked instance-counted objects at exit?"); |
55 DEFINE_string(skps, "", "Directory to read skps from."); | 56 DEFINE_string(skps, "", "Directory to read skps from."); |
56 | 57 |
57 DEFINE_bool(gms, true, "Run GMs?"); | 58 DEFINE_bool(gms, true, "Run GMs?"); |
58 DEFINE_bool(benches, true, "Run benches? Does not run GMs-as-benches."); | 59 DEFINE_bool(benches, true, "Run benches? Does not run GMs-as-benches."); |
59 DEFINE_bool(tests, true, "Run tests?"); | 60 DEFINE_bool(tests, true, "Run tests?"); |
60 | 61 |
| 62 DECLARE_bool(verbose); |
| 63 |
61 __SK_FORCE_IMAGE_DECODER_LINKING; | 64 __SK_FORCE_IMAGE_DECODER_LINKING; |
62 | 65 |
63 // "FooBar" -> "foobar". Obviously, ASCII only. | 66 // "FooBar" -> "foobar". Obviously, ASCII only. |
64 static SkString lowercase(SkString s) { | 67 static SkString lowercase(SkString s) { |
65 for (size_t i = 0; i < s.size(); i++) { | 68 for (size_t i = 0; i < s.size(); i++) { |
66 s[i] = tolower(s[i]); | 69 s[i] = tolower(s[i]); |
67 } | 70 } |
68 return s; | 71 return s; |
69 } | 72 } |
70 | 73 |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, forName->getName())) { | 204 if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, forName->getName())) { |
202 *out->append() = reg->factory(); | 205 *out->append() = reg->factory(); |
203 } | 206 } |
204 } | 207 } |
205 } | 208 } |
206 | 209 |
207 int tool_main(int argc, char** argv); | 210 int tool_main(int argc, char** argv); |
208 int tool_main(int argc, char** argv) { | 211 int tool_main(int argc, char** argv) { |
209 SkAutoGraphics ag; | 212 SkAutoGraphics ag; |
210 SkCommandLineFlags::Parse(argc, argv); | 213 SkCommandLineFlags::Parse(argc, argv); |
| 214 |
| 215 if (FLAGS_dryRun) { |
| 216 FLAGS_verbose = true; |
| 217 } |
211 #if SK_ENABLE_INST_COUNT | 218 #if SK_ENABLE_INST_COUNT |
212 gPrintInstCount = FLAGS_leaks; | 219 gPrintInstCount = FLAGS_leaks; |
213 #endif | 220 #endif |
214 GM::SetResourcePath(FLAGS_resources[0]); | 221 GM::SetResourcePath(FLAGS_resources[0]); |
215 SkBenchmark::SetResourcePath(FLAGS_resources[0]); | 222 SkBenchmark::SetResourcePath(FLAGS_resources[0]); |
216 Test::SetResourcePath(FLAGS_resources[0]); | 223 Test::SetResourcePath(FLAGS_resources[0]); |
217 | 224 |
218 SkTArray<SkString> configs; | 225 SkTArray<SkString> configs; |
219 for (int i = 0; i < FLAGS_config.count(); i++) { | 226 for (int i = 0; i < FLAGS_config.count(); i++) { |
220 SkStrSplit(FLAGS_config[i], ", ", &configs); | 227 SkStrSplit(FLAGS_config[i], ", ", &configs); |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 reporter.getFailures(&failures); | 270 reporter.getFailures(&failures); |
264 report_failures(failures); | 271 report_failures(failures); |
265 return failures.count() > 0; | 272 return failures.count() > 0; |
266 } | 273 } |
267 | 274 |
268 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 275 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
269 int main(int argc, char** argv) { | 276 int main(int argc, char** argv) { |
270 return tool_main(argc, argv); | 277 return tool_main(argc, argv); |
271 } | 278 } |
272 #endif | 279 #endif |
OLD | NEW |