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 "Test.h" | 8 #include "Test.h" |
9 | 9 |
10 #include "SkCommandLineFlags.h" | 10 #include "SkCommandLineFlags.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 void Reporter::reportFailed(const SkString& desc) { | 34 void Reporter::reportFailed(const SkString& desc) { |
35 this->onReportFailed(desc); | 35 this->onReportFailed(desc); |
36 } | 36 } |
37 | 37 |
38 void Reporter::endTest(Test* test) { | 38 void Reporter::endTest(Test* test) { |
39 this->onEnd(test); | 39 this->onEnd(test); |
40 } | 40 } |
41 | 41 |
42 /////////////////////////////////////////////////////////////////////////////// | 42 /////////////////////////////////////////////////////////////////////////////// |
43 | 43 |
44 const char* Test::gResourcePath; | |
45 | |
46 Test::Test() : fReporter(NULL), fPassed(true) {} | 44 Test::Test() : fReporter(NULL), fPassed(true) {} |
47 | 45 |
48 Test::~Test() { | 46 Test::~Test() { |
49 SkSafeUnref(fReporter); | 47 SkSafeUnref(fReporter); |
50 } | 48 } |
51 | 49 |
52 void Test::setReporter(Reporter* r) { | 50 void Test::setReporter(Reporter* r) { |
53 SkRefCnt_SafeAssign(fReporter, r); | 51 SkRefCnt_SafeAssign(fReporter, r); |
54 } | 52 } |
55 | 53 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 fReporter->reportFailed(local.failure(i)); | 113 fReporter->reportFailed(local.failure(i)); |
116 } | 114 } |
117 fReporter->endTest(this); | 115 fReporter->endTest(this); |
118 | 116 |
119 } | 117 } |
120 | 118 |
121 SkString Test::GetTmpDir() { | 119 SkString Test::GetTmpDir() { |
122 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; | 120 const char* tmpDir = FLAGS_tmpDir.isEmpty() ? NULL : FLAGS_tmpDir[0]; |
123 return SkString(tmpDir); | 121 return SkString(tmpDir); |
124 } | 122 } |
125 | |
126 void Test::SetResourcePath(const char* resourcePath) { | |
127 gResourcePath = resourcePath; | |
128 } | |
129 | |
130 SkString Test::GetResourcePath() { | |
131 return SkString(gResourcePath); | |
132 } | |
OLD | NEW |