diff options
author | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-13 16:16:36 +0000 |
---|---|---|
committer | commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2014-03-13 16:16:36 +0000 |
commit | b17ccc992da94e55cef07cedf5491911d78dfa3f (patch) | |
tree | 26f7c35baf3244e902dc3f6fc1525e0f1bb67162 /gm | |
parent | fb882d774e43dd6ca15fc646dc40b9db731c925b (diff) |
--dryRun flag for gm
Causes gm to not actually run any tests / create any directories, just print its normal output. Useful for showing what tests would be run without actually taking the time to run them.
BUG=skia:2294
R=reed@google.com
Author: humper@google.com
Review URL: https://codereview.chromium.org/199093002
git-svn-id: http://skia.googlecode.com/svn/trunk@13785 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'gm')
-rw-r--r-- | gm/gmmain.cpp | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index de9e1a15a0..52e7332b64 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(); |