OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #ifndef skiatest_Test_DEFINED | 8 #ifndef skiatest_Test_DEFINED |
9 #define skiatest_Test_DEFINED | 9 #define skiatest_Test_DEFINED |
10 | 10 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 virtual ~Test(); | 68 virtual ~Test(); |
69 | 69 |
70 Reporter* getReporter() const { return fReporter; } | 70 Reporter* getReporter() const { return fReporter; } |
71 void setReporter(Reporter*); | 71 void setReporter(Reporter*); |
72 | 72 |
73 const char* getName(); | 73 const char* getName(); |
74 void run(); | 74 void run(); |
75 bool passed() const { return fPassed; } | 75 bool passed() const { return fPassed; } |
76 SkMSec elapsedMs() const { return fElapsed; } | 76 SkMSec elapsedMs() const { return fElapsed; } |
77 | 77 |
78 static const SkString& GetTmpDir(); | 78 static SkString GetTmpDir(); |
79 | 79 |
80 static const SkString& GetResourcePath(); | 80 static SkString GetResourcePath(); |
81 | 81 |
82 virtual bool isThreadsafe() const { return true; } | 82 virtual bool isThreadsafe() const { return true; } |
83 | 83 |
84 protected: | 84 protected: |
85 virtual void onGetName(SkString*) = 0; | 85 virtual void onGetName(SkString*) = 0; |
86 virtual void onRun(Reporter*) = 0; | 86 virtual void onRun(Reporter*) = 0; |
87 | 87 |
88 private: | 88 private: |
89 Reporter* fReporter; | 89 Reporter* fReporter; |
90 SkString fName; | 90 SkString fName; |
(...skipping 26 matching lines...) Expand all Loading... |
117 do { \ | 117 do { \ |
118 if (!(cond)) { \ | 118 if (!(cond)) { \ |
119 SkString desc; \ | 119 SkString desc; \ |
120 desc.printf("%s %s:%d: %s", message, __FILE__, __LINE__, #cond); \ | 120 desc.printf("%s %s:%d: %s", message, __FILE__, __LINE__, #cond); \ |
121 r->reportFailed(desc); \ | 121 r->reportFailed(desc); \ |
122 } \ | 122 } \ |
123 } while(0) | 123 } while(0) |
124 | 124 |
125 | 125 |
126 #endif | 126 #endif |
OLD | NEW |