add options to enable/disable "FAILED to read ..." message
--disable-missing-warning
--enable-missing-warning
default is still enabled
git-svn-id: http://skia.googlecode.com/svn/trunk@3992 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 7185a73..66cbc0c 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -52,6 +52,9 @@
const static ErrorBitfield ERROR_READING_REFERENCE_IMAGE = 0x08;
const static ErrorBitfield ERROR_WRITING_REFERENCE_IMAGE = 0x10;
+// If true, emit a messange when we can't find a reference image to compare
+static bool gNotifyMissingReadReference;
+
using namespace skiagm;
class Iter {
@@ -450,7 +453,9 @@
orig, diffPath,
renderModeDescriptor);
} else {
- fprintf(stderr, "FAILED to read %s\n", path.c_str());
+ if (gNotifyMissingReadReference) {
+ fprintf(stderr, "FAILED to read %s\n", path.c_str());
+ }
return ERROR_READING_REFERENCE_IMAGE;
}
}
@@ -737,6 +742,8 @@
bool doDeferred = true;
bool disableTextureCache = false;
+ gNotifyMissingReadReference = true;
+
const char* const commandName = argv[0];
char* const* stop = argv + argc;
for (++argv; argv < stop; ++argv) {
@@ -768,6 +775,10 @@
doPDF = false;
} else if (strcmp(*argv, "--nodeferred") == 0) {
doDeferred = false;
+ } else if (strcmp(*argv, "--disable-missing-warning") == 0) {
+ gNotifyMissingReadReference = false;
+ } else if (strcmp(*argv, "--enable-missing-warning") == 0) {
+ gNotifyMissingReadReference = true;
} else if (strcmp(*argv, "--serialize") == 0) {
doSerialize = true;
} else if (strcmp(*argv, "--match") == 0) {