| OLD | NEW |
| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 } | 47 } |
| 48 | 48 |
| 49 private: | 49 private: |
| 50 const TestRegistry* fReg; | 50 const TestRegistry* fReg; |
| 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 bool allowExtendedTest() const SK_OVERRIDE { return FLAGS_extendedTest; } |
| 58 virtual bool verbose() const SK_OVERRIDE { return FLAGS_veryVerbos
e; } | 58 bool verbose() const SK_OVERRIDE { return FLAGS_veryVerbose; } |
| 59 | 59 |
| 60 protected: | 60 protected: |
| 61 virtual void onReportFailed(const skiatest::Failure& failure) SK_OVERRIDE { | 61 void onReportFailed(const skiatest::Failure& failure) SK_OVERRIDE { |
| 62 SkString desc; | 62 SkString desc; |
| 63 failure.getFailureString(&desc); | 63 failure.getFailureString(&desc); |
| 64 SkDebugf("\nFAILED: %s", desc.c_str()); | 64 SkDebugf("\nFAILED: %s", desc.c_str()); |
| 65 } | 65 } |
| 66 | 66 |
| 67 virtual void onEnd(Test* test) SK_OVERRIDE { | 67 void onEnd(Test* test) SK_OVERRIDE { |
| 68 const int done = 1 + sk_atomic_inc(&fDone); | 68 const int done = 1 + sk_atomic_inc(&fDone); |
| 69 | 69 |
| 70 if (!test->passed()) { | 70 if (!test->passed()) { |
| 71 SkDebugf("\n---- %s FAILED", test->getName()); | 71 SkDebugf("\n---- %s FAILED", test->getName()); |
| 72 } | 72 } |
| 73 | 73 |
| 74 SkString prefix(kSkOverwriteLine); | 74 SkString prefix(kSkOverwriteLine); |
| 75 SkString time; | 75 SkString time; |
| 76 if (FLAGS_verbose) { | 76 if (FLAGS_verbose) { |
| 77 prefix.printf("\n"); | 77 prefix.printf("\n"); |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 SkDebugf("\n"); | 217 SkDebugf("\n"); |
| 218 return (failCount == 0) ? 0 : 1; | 218 return (failCount == 0) ? 0 : 1; |
| 219 } | 219 } |
| 220 | 220 |
| 221 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) | 221 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
| 222 int main(int argc, char** argv) { | 222 int main(int argc, char** argv) { |
| 223 SkCommandLineFlags::Parse(argc, argv); | 223 SkCommandLineFlags::Parse(argc, argv); |
| 224 return test_main(); | 224 return test_main(); |
| 225 } | 225 } |
| 226 #endif | 226 #endif |
| OLD | NEW |