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

Side by Side Diff: tests/skia_test.cpp

Issue 694703005: When running DM, write test failures to json. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use "" instead of NULL Created 6 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « tests/Test.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 "CrashHandler.h" 8 #include "CrashHandler.h"
9 #include "OverwriteLine.h" 9 #include "OverwriteLine.h"
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 }; 51 };
52 52
53 class DebugfReporter : public Reporter { 53 class DebugfReporter : public Reporter {
54 public: 54 public:
55 explicit DebugfReporter(int total) : fDone(0), fTotal(total) {} 55 explicit DebugfReporter(int total) : fDone(0), fTotal(total) {}
56 56
57 virtual bool allowExtendedTest() const SK_OVERRIDE { return FLAGS_extendedTe st; } 57 virtual bool allowExtendedTest() const SK_OVERRIDE { return FLAGS_extendedTe st; }
58 virtual bool verbose() const SK_OVERRIDE { return FLAGS_veryVerbos e; } 58 virtual bool verbose() const SK_OVERRIDE { return FLAGS_veryVerbos e; }
59 59
60 protected: 60 protected:
61 virtual void onReportFailed(const SkString& desc) SK_OVERRIDE { 61 virtual void onReportFailed(const skiatest::Failure& failure) SK_OVERRIDE {
62 SkString desc;
63 failure.getFailureString(&desc);
62 SkDebugf("\nFAILED: %s", desc.c_str()); 64 SkDebugf("\nFAILED: %s", desc.c_str());
63 } 65 }
64 66
65 virtual void onEnd(Test* test) SK_OVERRIDE { 67 virtual void onEnd(Test* test) SK_OVERRIDE {
66 const int done = 1 + sk_atomic_inc(&fDone); 68 const int done = 1 + sk_atomic_inc(&fDone);
67 69
68 if (!test->passed()) { 70 if (!test->passed()) {
69 SkDebugf("\n---- %s FAILED", test->getName()); 71 SkDebugf("\n---- %s FAILED", test->getName());
70 } 72 }
71 73
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 SkDebugf("\n"); 218 SkDebugf("\n");
217 return (failCount == 0) ? 0 : 1; 219 return (failCount == 0) ? 0 : 1;
218 } 220 }
219 221
220 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 222 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
221 int main(int argc, char** argv) { 223 int main(int argc, char** argv) {
222 SkCommandLineFlags::Parse(argc, argv); 224 SkCommandLineFlags::Parse(argc, argv);
223 return test_main(); 225 return test_main();
224 } 226 }
225 #endif 227 #endif
OLDNEW
« no previous file with comments | « tests/Test.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698