| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "gm_expectations.h" | 8 #include "gm_expectations.h" |
| 9 #include "SkBitmapHasher.h" | 9 #include "SkBitmapHasher.h" |
| 10 #include "SkImageDecoder.h" | 10 #include "SkImageDecoder.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 | 28 |
| 29 namespace skiagm { | 29 namespace skiagm { |
| 30 SK_DEFINE_INST_COUNT(ExpectationsSource) | 30 SK_DEFINE_INST_COUNT(ExpectationsSource) |
| 31 | 31 |
| 32 void gm_fprintf(FILE *stream, const char format[], ...) { | 32 void gm_fprintf(FILE *stream, const char format[], ...) { |
| 33 va_list args; | 33 va_list args; |
| 34 va_start(args, format); | 34 va_start(args, format); |
| 35 fprintf(stream, "GM: "); | 35 fprintf(stream, "GM: "); |
| 36 vfprintf(stream, format, args); | 36 vfprintf(stream, format, args); |
| 37 #ifdef SK_BUILD_FOR_WIN |
| 38 if (stderr == stream || stdout == stream) { |
| 39 fflush(stream); |
| 40 } |
| 41 #endif |
| 37 va_end(args); | 42 va_end(args); |
| 38 } | 43 } |
| 39 | 44 |
| 40 Json::Value CreateJsonTree(Json::Value expectedResults, | 45 Json::Value CreateJsonTree(Json::Value expectedResults, |
| 41 Json::Value actualResultsFailed, | 46 Json::Value actualResultsFailed, |
| 42 Json::Value actualResultsFailureIgnored, | 47 Json::Value actualResultsFailureIgnored, |
| 43 Json::Value actualResultsNoComparison, | 48 Json::Value actualResultsNoComparison, |
| 44 Json::Value actualResultsSucceeded) { | 49 Json::Value actualResultsSucceeded) { |
| 45 Json::Value actualResults; | 50 Json::Value actualResults; |
| 46 actualResults[kJsonKey_ActualResults_Failed] = actualResultsFailed; | 51 actualResults[kJsonKey_ActualResults_Failed] = actualResultsFailed; |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 Json::Reader reader; | 268 Json::Reader reader; |
| 264 if (!reader.parse(bytes, bytes+size, *jsonRoot)) { | 269 if (!reader.parse(bytes, bytes+size, *jsonRoot)) { |
| 265 gm_fprintf(stderr, "error parsing JSON file %s\n", jsonPath); | 270 gm_fprintf(stderr, "error parsing JSON file %s\n", jsonPath); |
| 266 DEBUGFAIL_SEE_STDERR; | 271 DEBUGFAIL_SEE_STDERR; |
| 267 return false; | 272 return false; |
| 268 } | 273 } |
| 269 return true; | 274 return true; |
| 270 } | 275 } |
| 271 | 276 |
| 272 } | 277 } |
| OLD | NEW |