Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(513)

Unified Diff: gm/gmmain.cpp

Issue 199093002: dryRun flag for gm (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gm/gmmain.cpp
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index de9e1a15a0566934abfcfc21be23863916b0a93c..52e7332b64da25e453369ae95c851b77595a3bf8 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -1421,6 +1421,7 @@ static SkString pdfRasterizerUsage() {
DEFINE_string(config, "", configUsage().c_str());
DEFINE_string(pdfRasterizers, "default", pdfRasterizerUsage().c_str());
DEFINE_bool(deferred, false, "Exercise the deferred rendering test pass.");
+DEFINE_bool(dryRun, false, "Don't actually run the tests, just print what would have been done.");
DEFINE_string(excludeConfig, "", "Space delimited list of configs to skip.");
DEFINE_bool(forceBWtext, false, "Disable text anti-aliasing.");
#if SK_SUPPORT_GPU
@@ -2237,6 +2238,10 @@ int tool_main(int argc, char** argv) {
GrContextFactory* grFactory = NULL;
#endif
+ if (FLAGS_dryRun) {
+ SkDebugf( "Doing a dry run; no tests will actually be executed.\n");
+ }
+
if (!parse_flags_modulo(&moduloRemainder, &moduloDivisor) ||
!parse_flags_ignore_error_types(&gmmain.fIgnorableErrorTypes) ||
!parse_flags_ignore_tests(gmmain.fIgnorableTestNames) ||
@@ -2275,26 +2280,27 @@ int tool_main(int argc, char** argv) {
int gmIndex = -1;
SkString moduloStr;
- // If we will be writing out files, prepare subdirectories.
- if (FLAGS_writePath.count() == 1) {
- if (!prepare_subdirectories(FLAGS_writePath[0], gmmain.fUseFileHierarchy,
- configs, pdfRasterizers)) {
- return -1;
+ if (!FLAGS_dryRun) {
+ // If we will be writing out files, prepare subdirectories.
+ if (FLAGS_writePath.count() == 1) {
+ if (!prepare_subdirectories(FLAGS_writePath[0], gmmain.fUseFileHierarchy,
+ configs, pdfRasterizers)) {
+ return -1;
+ }
}
- }
- if (NULL != gmmain.fMismatchPath) {
- if (!prepare_subdirectories(gmmain.fMismatchPath, gmmain.fUseFileHierarchy,
- configs, pdfRasterizers)) {
- return -1;
+ if (NULL != gmmain.fMismatchPath) {
+ if (!prepare_subdirectories(gmmain.fMismatchPath, gmmain.fUseFileHierarchy,
+ configs, pdfRasterizers)) {
+ return -1;
+ }
}
- }
- if (NULL != gmmain.fMissingExpectationsPath) {
- if (!prepare_subdirectories(gmmain.fMissingExpectationsPath, gmmain.fUseFileHierarchy,
- configs, pdfRasterizers)) {
- return -1;
+ if (NULL != gmmain.fMissingExpectationsPath) {
+ if (!prepare_subdirectories(gmmain.fMissingExpectationsPath, gmmain.fUseFileHierarchy,
+ configs, pdfRasterizers)) {
+ return -1;
+ }
}
}
-
Iter iter;
GM* gm;
while ((gm = iter.next()) != NULL) {
@@ -2326,10 +2332,13 @@ int tool_main(int argc, char** argv) {
SkISize size = gm->getISize();
SkDebugf("%sdrawing... %s [%d %d]\n", moduloStr.c_str(), shortName,
size.width(), size.height());
-
- run_multiple_configs(gmmain, gm, configs, pdfRasterizers, tileGridReplayScales, grFactory);
+ if (!FLAGS_dryRun)
+ run_multiple_configs(gmmain, gm, configs, pdfRasterizers, tileGridReplayScales, grFactory);
}
+ if (FLAGS_dryRun)
+ return 0;
+
SkTArray<SkString> modes;
gmmain.GetRenderModesEncountered(modes);
int modeCount = modes.count();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698