| 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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 } | 88 } |
| 89 bool verbose() const override { return FLAGS_veryVerbose; } | 89 bool verbose() const override { return FLAGS_veryVerbose; } |
| 90 void reportFailed(const skiatest::Failure& failure) override { | 90 void reportFailed(const skiatest::Failure& failure) override { |
| 91 SkDebugf("\nFAILED: %s", failure.toString().c_str()); | 91 SkDebugf("\nFAILED: %s", failure.toString().c_str()); |
| 92 fError = true; | 92 fError = true; |
| 93 } | 93 } |
| 94 bool fError; | 94 bool fError; |
| 95 int fTestCount; | 95 int fTestCount; |
| 96 } reporter; | 96 } reporter; |
| 97 | 97 |
| 98 const SkMSec start = SkTime::GetMSecs(); | 98 const Timer timer; |
| 99 fTest.proc(&reporter, fGrContextFactory); | 99 fTest.proc(&reporter, fGrContextFactory); |
| 100 SkMSec elapsed = SkTime::GetMSecs() - start; | 100 SkMSec elapsed = timer.elapsedMsInt(); |
| 101 if (reporter.fError) { | 101 if (reporter.fError) { |
| 102 fStatus->reportFailure(); | 102 fStatus->reportFailure(); |
| 103 } | 103 } |
| 104 fStatus->endTest(fTest.name, !reporter.fError, elapsed, | 104 fStatus->endTest(fTest.name, !reporter.fError, elapsed, |
| 105 reporter.fTestCount); | 105 reporter.fTestCount); |
| 106 } | 106 } |
| 107 | 107 |
| 108 private: | 108 private: |
| 109 Test fTest; | 109 Test fTest; |
| 110 Status* fStatus; | 110 Status* fStatus; |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 SkDebugf("\n"); | 220 SkDebugf("\n"); |
| 221 return (status.failCount() == 0) ? 0 : 1; | 221 return (status.failCount() == 0) ? 0 : 1; |
| 222 } | 222 } |
| 223 | 223 |
| 224 #if !defined(SK_BUILD_FOR_IOS) | 224 #if !defined(SK_BUILD_FOR_IOS) |
| 225 int main(int argc, char** argv) { | 225 int main(int argc, char** argv) { |
| 226 SkCommandLineFlags::Parse(argc, argv); | 226 SkCommandLineFlags::Parse(argc, argv); |
| 227 return test_main(); | 227 return test_main(); |
| 228 } | 228 } |
| 229 #endif | 229 #endif |
| OLD | NEW |