Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2)

Unified Diff: gm/gmmain.cpp

Issue 26650005: gm: if test has no expectations, record its result as no-expectations regardless of ignoreFailure (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: gm/gmmain.cpp
===================================================================
--- gm/gmmain.cpp (revision 11682)
+++ gm/gmmain.cpp (working copy)
@@ -821,7 +821,7 @@
}
/**
- * Add this result to the appropriate JSON collection of actual results,
+ * Add this result to the appropriate JSON collection of actual results (but just ONE),
* depending on errors encountered.
*/
void add_actual_results_to_json_summary(const char testName[],
@@ -829,34 +829,36 @@
ErrorCombination errors,
bool ignoreFailure) {
Json::Value jsonActualResults = actualResultDigest.asJsonTypeValuePair();
+ Json::Value *resultCollection = NULL;
+
if (errors.isEmpty()) {
- this->fJsonActualResults_Succeeded[testName] = jsonActualResults;
- } else {
+ resultCollection = &this->fJsonActualResults_Succeeded;
+ } else if (errors.includes(kRenderModeMismatch_ErrorType)) {
+ resultCollection = &this->fJsonActualResults_Failed;
+ } else if (errors.includes(kExpectationsMismatch_ErrorType)) {
if (ignoreFailure) {
- this->fJsonActualResults_FailureIgnored[testName] =
- jsonActualResults;
+ resultCollection = &this->fJsonActualResults_FailureIgnored;
} else {
- if (errors.includes(kMissingExpectations_ErrorType)) {
- // TODO: What about the case where there IS an
- // expected image hash digest, but that gm test
- // doesn't actually run? For now, those cases
- // will always be ignored, because gm only looks
- // at expectations that correspond to gm tests
- // that were actually run.
- //
- // Once we have the ability to express
- // expectations as a JSON file, we should fix this
- // (and add a test case for which an expectation
- // is given but the test is never run).
- this->fJsonActualResults_NoComparison[testName] =
- jsonActualResults;
- }
- if (errors.includes(kExpectationsMismatch_ErrorType) ||
- errors.includes(kRenderModeMismatch_ErrorType)) {
- this->fJsonActualResults_Failed[testName] = jsonActualResults;
- }
+ resultCollection = &this->fJsonActualResults_Failed;
}
+ } else if (errors.includes(kMissingExpectations_ErrorType)) {
+ // TODO: What about the case where there IS an expected
+ // image hash digest, but that gm test doesn't actually
+ // run? For now, those cases will always be ignored,
+ // because gm only looks at expectations that correspond
+ // to gm tests that were actually run.
+ //
+ // Once we have the ability to express expectations as a
+ // JSON file, we should fix this (and add a test case for
+ // which an expectation is given but the test is never
+ // run).
+ resultCollection = &this->fJsonActualResults_NoComparison;
}
+
+ // If none of the above cases match, we don't add it to ANY tally of actual results.
+ if (resultCollection) {
+ (*resultCollection)[testName] = jsonActualResults;
+ }
}
/**

Powered by Google App Engine
This is Rietveld 408576698