fBGColor = SK_ColorWHITE;
fCanvasIsDeferred = false;
fHaveCalledOnceBeforeDraw = false;
+ fIgnoreFailures = false;
}
GM::~GM() {}
return gResourcePath;
}
+ bool isIgnoringFailures() const { return fIgnoreFailures; }
+ void setIgnoreFailures(bool val) {
+ fIgnoreFailures = val;
+ }
+
bool isCanvasDeferred() const { return fCanvasIsDeferred; }
void setCanvasIsDeferred(bool isDeferred) {
fCanvasIsDeferred = isDeferred;
SkColor fBGColor;
bool fCanvasIsDeferred; // work-around problem in srcmode.cpp
bool fHaveCalledOnceBeforeDraw;
+ bool fIgnoreFailures; // whether to file any failures as failure-ignored
};
typedef SkTRegistry<GM*(*)(void*)> GMRegistry;
*/
bool ignoreFailure() const { return this->fIgnoreFailure; }
+ /**
+ * Override default setting of fIgnoreFailure.
+ */
+ void setIgnoreFailure(bool val) { this->fIgnoreFailure = val; }
+
/**
* Returns true iff there are no allowed results.
*/
* 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 {
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"
if (SkCommandLineFlags::ShouldSkip(FLAGS_match, shortName)) {
continue;
}
+ if (FLAGS_ignoreTests.contains(shortName)) {
+ gm->setIgnoreFailures(true);
+ }
gmsRun++;
SkISize size = gm->getISize();
--- /dev/null
+out/Debug/gm --verbose --hierarchy --match selftest1 --ignoreTests selftest1 --config 8888 565 -r gm/tests/inputs/json/different-pixels.json --writeJsonSummaryPath gm/tests/outputs/ignoring-one-test/output-actual/json-summary.txt --writePath gm/tests/outputs/ignoring-one-test/output-actual/writePath --mismatchPath gm/tests/outputs/ignoring-one-test/output-actual/mismatchPath --missingExpectationsPath gm/tests/outputs/ignoring-one-test/output-actual/missingExpectationsPath
--- /dev/null
+{
+ "actual-results" : {
+ "failed" : null,
+ "failure-ignored" : {
+ "565/selftest1.png" : [ "bitmap-64bitMD5", 12927999507540085554 ],
+ "8888/selftest1.png" : [ "bitmap-64bitMD5", 1209453360120438698 ]
+ },
+ "no-comparison" : null,
+ "succeeded" : null
+ },
+ "expected-results" : {
+ "565/selftest1.png" : {
+ "allowed-digests" : [
+ [ "bitmap-64bitMD5", 8863920166200910451 ]
+ ],
+ "ignore-failure" : true
+ },
+ "8888/selftest1.png" : {
+ "allowed-digests" : [
+ [ "bitmap-64bitMD5", 13451349865803053525 ]
+ ],
+ "ignore-failure" : true
+ }
+ }
+}
--- /dev/null
+Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories.
--- /dev/null
+[contents of gm/tests/outputs/ignoring-one-test/output-actual/mismatchPath/565/selftest1.png]
--- /dev/null
+Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories.
--- /dev/null
+[contents of gm/tests/outputs/ignoring-one-test/output-actual/mismatchPath/8888/selftest1.png]
--- /dev/null
+Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories.
--- /dev/null
+Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories.
--- /dev/null
+Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories.
--- /dev/null
+Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories.
--- /dev/null
+GM: These configs will be run: 8888 565
+GM: reading expectations from JSON summary file gm/tests/inputs/json/different-pixels.json
+GM: writing to gm/tests/outputs/ignoring-one-test/output-actual/writePath
+GM: writing mismatches to gm/tests/outputs/ignoring-one-test/output-actual/mismatchPath
+GM: writing images without expectations to gm/tests/outputs/ignoring-one-test/output-actual/missingExpectationsPath
+GM: drawing... selftest1 [300 200]
+GM: Ran 1 GMs
+GM: ... over 2 configs ["8888", "565"]
+GM: ... and 0 modes []
+GM: ... so there should be a total of 2 tests.
+GM: Ran 2 tests: NoGpuContext=0 IntentionallySkipped=0 RenderModeMismatch=0 ExpectationsMismatch=2 MissingExpectations=0 WritingReferenceImage=0
+GM: [*] 0 NoGpuContext:
+GM: [ ] 0 IntentionallySkipped:
+GM: [*] 0 RenderModeMismatch:
+GM: [*] 2 ExpectationsMismatch: 8888/selftest1 565/selftest1
+GM: [ ] 0 MissingExpectations:
+GM: [*] 0 WritingReferenceImage:
+GM: (results marked with [*] will cause nonzero return value)
--- /dev/null
+Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories.
--- /dev/null
+[contents of gm/tests/outputs/ignoring-one-test/output-actual/writePath/565/selftest1.png]
--- /dev/null
+Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories.
--- /dev/null
+[contents of gm/tests/outputs/ignoring-one-test/output-actual/writePath/8888/selftest1.png]
--- /dev/null
+Created additional file to make sure directory isn't empty, because self-test cannot handle empty directories.
gm_test "--verbose --hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/different-pixels" "$GM_OUTPUTS/compared-against-different-pixels-images"
gm_test "--verbose --hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/json/different-pixels.json" "$GM_OUTPUTS/compared-against-different-pixels-json"
+# Exercise --ignoreTests flag.
+gm_test "--verbose --hierarchy --match selftest1 --ignoreTests selftest1 $CONFIGS -r $GM_INPUTS/json/different-pixels.json" "$GM_OUTPUTS/ignoring-one-test"
+
# Compare different pixels, but with a SUBSET of the expectations marked as
# ignore-failure.
gm_test "--verbose --hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/json/different-pixels-ignore-some-failures.json" "$GM_OUTPUTS/ignoring-some-failures"
bool isEmpty() const { return this->count() == 0; }
+ /**
+ * Returns true iff string is equal to one of the strings in this array.
+ */
+ bool contains(const char* string) const {
+ for (int i = 0; i < fStrings.count(); i++) {
+ if (fStrings[i].equals(string)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
private:
void reset() { fStrings.reset(); }