diff options
author | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-10 18:46:25 +0000 |
---|---|---|
committer | epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-04-10 18:46:25 +0000 |
commit | b0f8b430de74a51f35dbfbff5284a04f8d70ec48 (patch) | |
tree | f1f1aa3167fd2171516981dcd09f42ddcd88e4f2 | |
parent | 7a90daf25878a7459ba9fbda581bb97cda034f02 (diff) |
GM: remove enableMissingWarning in favor of verbose flag, and trim output in nonverbose mode
Review URL: https://codereview.chromium.org/14080003
git-svn-id: http://skia.googlecode.com/svn/trunk@8600 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | gm/gm_expectations.h | 10 | ||||
-rw-r--r-- | gm/gmmain.cpp | 50 | ||||
-rw-r--r-- | gm/tests/outputs/compared-against-empty-dir/output-expected/stderr | 2 | ||||
-rw-r--r-- | gm/tests/outputs/nonverbose/output-expected/stderr | 2 | ||||
-rw-r--r-- | gm/tests/outputs/nonverbose/output-expected/stdout | 2 |
5 files changed, 29 insertions, 37 deletions
diff --git a/gm/gm_expectations.h b/gm/gm_expectations.h index 2efdd4b043..3d3f2b55fa 100644 --- a/gm/gm_expectations.h +++ b/gm/gm_expectations.h @@ -225,12 +225,8 @@ namespace skiagm { * * rootDir: directory under which to look for image files * (this string will be copied to storage within this object) - * notifyOfMissingFiles: whether to log a message to stderr if an image - * file cannot be found */ - IndividualImageExpectationsSource(const char *rootDir, - bool notifyOfMissingFiles) : - fRootDir(rootDir), fNotifyOfMissingFiles(notifyOfMissingFiles) {} + IndividualImageExpectationsSource(const char *rootDir) : fRootDir(rootDir) {} Expectations get(const char *testName) SK_OVERRIDE { SkString path = make_filename(fRootDir.c_str(), "", testName, @@ -244,16 +240,12 @@ namespace skiagm { if (decodedReferenceBitmap) { return Expectations(referenceBitmap); } else { - if (fNotifyOfMissingFiles) { - gm_fprintf(stderr, "FAILED to read %s\n", path.c_str()); - } return Expectations(); } } private: const SkString fRootDir; - const bool fNotifyOfMissingFiles; }; /** diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp index 8cb74be733..bc11d4afad 100644 --- a/gm/gmmain.cpp +++ b/gm/gmmain.cpp @@ -1191,8 +1191,6 @@ static SkString configUsage() { // Alphabetized ignoring "no" prefix ("readPath", "noreplay", "resourcePath"). DEFINE_string(config, "", configUsage().c_str()); DEFINE_bool(deferred, true, "Exercise the deferred rendering test pass."); -DEFINE_bool(enableMissingWarning, true, "Print message to stderr (but don't fail) if " - "unable to read a reference image for any tests."); DEFINE_string(excludeConfig, "", "Space delimited list of configs to skip."); DEFINE_bool(forceBWtext, false, "Disable text anti-aliasing."); #if SK_SUPPORT_GPU @@ -1222,7 +1220,8 @@ DEFINE_bool(tileGrid, true, "Exercise the tile grid variant of SkPicture."); DEFINE_string(tileGridReplayScales, "", "Space separated list of floating-point scale " "factors to be used for tileGrid playback testing. Default value: 1.0"); DEFINE_string(writeJsonSummaryPath, "", "Write a JSON-formatted result summary to this file."); -DEFINE_bool2(verbose, v, false, "Print diagnostics (e.g. list each config to be tested)."); +DEFINE_bool2(verbose, v, false, "Give more detail (e.g. list all GMs run, more info about " + "each test)."); DEFINE_string2(writePath, w, "", "Write rendered images into this directory."); DEFINE_string2(writePicturePath, p, "", "Write .skp files into this directory."); @@ -1687,14 +1686,14 @@ int tool_main(int argc, char** argv) { if (kGPU_Backend == gRec[index].fBackend) { GrContext* ctx = grFactory->get(gRec[index].fGLContextType); if (NULL == ctx) { - SkDebugf("GrContext could not be created for config %s. Config will be skipped.", - gRec[index].fName); + gm_fprintf(stderr, "GrContext could not be created for config %s." + " Config will be skipped.\n", gRec[index].fName); configs.remove(i); --i; } if (gRec[index].fSampleCnt > ctx->getMaxSampleCount()) { - SkDebugf("Sample count (%d) of config %s is not supported. Config will be skipped.", - gRec[index].fSampleCnt, gRec[index].fName); + gm_fprintf(stderr, "Sample count (%d) of config %s is not supported." + " Config will be skipped.\n", gRec[index].fSampleCnt, gRec[index].fName); configs.remove(i); --i; } @@ -1715,24 +1714,29 @@ int tool_main(int argc, char** argv) { return -1; } if (sk_isdir(readPath)) { - gm_fprintf(stdout, "reading from %s\n", readPath); + if (FLAGS_verbose) { + gm_fprintf(stdout, "reading from %s\n", readPath); + } gmmain.fExpectationsSource.reset(SkNEW_ARGS( - IndividualImageExpectationsSource, - (readPath, FLAGS_enableMissingWarning))); + IndividualImageExpectationsSource, (readPath))); } else { - gm_fprintf(stdout, "reading expectations from JSON summary file %s\n", readPath); + if (FLAGS_verbose) { + gm_fprintf(stdout, "reading expectations from JSON summary file %s\n", readPath); + } gmmain.fExpectationsSource.reset(SkNEW_ARGS( JsonExpectationsSource, (readPath))); } } - if (FLAGS_writePath.count() == 1) { - gm_fprintf(stderr, "writing to %s\n", FLAGS_writePath[0]); - } - if (FLAGS_writePicturePath.count() == 1) { - gm_fprintf(stderr, "writing pictures to %s\n", FLAGS_writePicturePath[0]); - } - if (FLAGS_resourcePath.count() == 1) { - gm_fprintf(stderr, "reading resources from %s\n", FLAGS_resourcePath[0]); + if (FLAGS_verbose) { + if (FLAGS_writePath.count() == 1) { + gm_fprintf(stdout, "writing to %s\n", FLAGS_writePath[0]); + } + if (FLAGS_writePicturePath.count() == 1) { + gm_fprintf(stdout, "writing pictures to %s\n", FLAGS_writePicturePath[0]); + } + if (FLAGS_resourcePath.count() == 1) { + gm_fprintf(stdout, "reading resources from %s\n", FLAGS_resourcePath[0]); + } } if (moduloDivisor <= 0) { @@ -1784,8 +1788,10 @@ int tool_main(int argc, char** argv) { gmsRun++; SkISize size = gm->getISize(); - gm_fprintf(stdout, "%sdrawing... %s [%d %d]\n", moduloStr.c_str(), shortName, - size.width(), size.height()); + if (FLAGS_verbose) { + gm_fprintf(stdout, "%sdrawing... %s [%d %d]\n", moduloStr.c_str(), shortName, + size.width(), size.height()); + } run_multiple_configs(gmmain, gm, configs, grFactory); @@ -1852,7 +1858,7 @@ int tool_main(int argc, char** argv) { for (int i = 0; i < configs.count(); i++) { ConfigData config = gRec[configs[i]]; - if (kGPU_Backend == config.fBackend) { + if (FLAGS_verbose && (kGPU_Backend == config.fBackend)) { GrContext* gr = grFactory->get(config.fGLContextType); gm_fprintf(stdout, "config: %s %x\n", config.fName, gr); diff --git a/gm/tests/outputs/compared-against-empty-dir/output-expected/stderr b/gm/tests/outputs/compared-against-empty-dir/output-expected/stderr index 2e951cfede..e69de29bb2 100644 --- a/gm/tests/outputs/compared-against-empty-dir/output-expected/stderr +++ b/gm/tests/outputs/compared-against-empty-dir/output-expected/stderr @@ -1,2 +0,0 @@ -GM: FAILED to read gm/tests/inputs/images/empty-dir/8888/selftest1.png -GM: FAILED to read gm/tests/inputs/images/empty-dir/565/selftest1.png diff --git a/gm/tests/outputs/nonverbose/output-expected/stderr b/gm/tests/outputs/nonverbose/output-expected/stderr index 2e951cfede..e69de29bb2 100644 --- a/gm/tests/outputs/nonverbose/output-expected/stderr +++ b/gm/tests/outputs/nonverbose/output-expected/stderr @@ -1,2 +0,0 @@ -GM: FAILED to read gm/tests/inputs/images/empty-dir/8888/selftest1.png -GM: FAILED to read gm/tests/inputs/images/empty-dir/565/selftest1.png diff --git a/gm/tests/outputs/nonverbose/output-expected/stdout b/gm/tests/outputs/nonverbose/output-expected/stdout index 6139fdbdc4..e666a0bac4 100644 --- a/gm/tests/outputs/nonverbose/output-expected/stdout +++ b/gm/tests/outputs/nonverbose/output-expected/stdout @@ -1,5 +1,3 @@ -GM: reading from gm/tests/inputs/images/empty-dir -GM: drawing... selftest1 [300 200] GM: Ran 9 tests: NoGpuContext=0 IntentionallySkipped=0 RenderModeMismatch=0 ExpectationsMismatch=0 MissingExpectations=2 WritingReferenceImage=0 GM: [*] 0 NoGpuContext: GM: [ ] 0 IntentionallySkipped |