gm: add --ignoreTests flag
BUG=skia:1600
R=scroggo@google.com

Review URL: https://codereview.chromium.org/23526065

git-svn-id: http://skia.googlecode.com/svn/trunk@11374 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 4939624..2cd8f47 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -905,6 +905,9 @@
                  * See comments above complete_bitmap() for more detail.
                  */
                 Expectations expectations = expectationsSource->get(nameWithExtension.c_str());
+                if (gm->isIgnoringFailures()) {
+                    expectations.setIgnoreFailure(true);
+                }
                 errors.add(compare_to_expectations(expectations, *actualBitmapAndDigest,
                                                    gm->shortName(), configName, "", true));
             } else {
@@ -1380,6 +1383,8 @@
 DEFINE_string(ignoreErrorTypes, kDefaultIgnorableErrorTypes.asString(" ").c_str(),
               "Space-separated list of ErrorTypes that should be ignored. If any *other* error "
               "types are encountered, the tool will exit with a nonzero return value.");
+DEFINE_string(ignoreTests, "", "Space delimited list of tests for which we should ignore "
+              "failures.");
 DEFINE_string(match, "", "[~][^]substring[$] [...] of test name to run.\n"
               "Multiple matches may be separated by spaces.\n"
               "~ causes a matching test to always be skipped\n"
@@ -2163,6 +2168,9 @@
         if (SkCommandLineFlags::ShouldSkip(FLAGS_match, shortName)) {
             continue;
         }
+        if (FLAGS_ignoreTests.contains(shortName)) {
+            gm->setIgnoreFailures(true);
+        }
 
         gmsRun++;
         SkISize size = gm->getISize();