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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 if (x != 15) { | 67 if (x != 15) { |
68 ERRORF(reporter, "x should be 15, but is %d", x); | 68 ERRORF(reporter, "x should be 15, but is %d", x); |
69 return; | 69 return; |
70 } | 70 } |
71 ... | 71 ... |
72 } | 72 } |
73 */ | 73 */ |
74 enum GPUTestContexts { | 74 enum GPUTestContexts { |
75 kNone_GPUTestContexts = 0, | 75 kNone_GPUTestContexts = 0, |
76 kNull_GPUTestContexts = 1, | 76 kNull_GPUTestContexts = 1, |
77 kNative_GPUTestContexts = 1 << 1, | 77 kDebug_GPUTestContexts = 1 << 1, |
78 kOther_GPUTestContexts = 1 << 2, // Other than native, used only for
below. | 78 kNative_GPUTestContexts = 1 << 2, |
| 79 kOther_GPUTestContexts = 1 << 3, // Other than native, used only for
below. |
79 kAllRendering_GPUTestContexts = kNative_GPUTestContexts | kOther_GPUTestCont
exts, | 80 kAllRendering_GPUTestContexts = kNative_GPUTestContexts | kOther_GPUTestCont
exts, |
80 kAll_GPUTestContexts = kAllRendering_GPUTestContexts | kNull_GPUTes
tContexts | 81 kAll_GPUTestContexts = kAllRendering_GPUTestContexts |
| 82 | kNull_GPUTestContexts |
| 83 | kDebug_GPUTestContexts |
81 }; | 84 }; |
82 template<typename T> | 85 template<typename T> |
83 void RunWithGPUTestContexts(T testFunction, GPUTestContexts contexts, Reporter*
reporter, | 86 void RunWithGPUTestContexts(T testFunction, GPUTestContexts contexts, Reporter*
reporter, |
84 GrContextFactory* factory); | 87 GrContextFactory* factory); |
85 } // namespace skiatest | 88 } // namespace skiatest |
86 | 89 |
87 #define REPORTER_ASSERT(r, cond) \ | 90 #define REPORTER_ASSERT(r, cond) \ |
88 do { \ | 91 do { \ |
89 if (!(cond)) { \ | 92 if (!(cond)) { \ |
90 REPORT_FAILURE(r, #cond, SkString()); \ | 93 REPORT_FAILURE(r, #cond, SkString()); \ |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 SkAutoTUnref<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \ | 153 SkAutoTUnref<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \ |
151 if (!testDoc) { \ | 154 if (!testDoc) { \ |
152 if ((REPORTER) && (REPORTER)->verbose()) { \ | 155 if ((REPORTER) && (REPORTER)->verbose()) { \ |
153 SkDebugf("PDF disabled; %s test skipped.", #TEST_NAME); \ | 156 SkDebugf("PDF disabled; %s test skipped.", #TEST_NAME); \ |
154 } \ | 157 } \ |
155 return; \ | 158 return; \ |
156 } \ | 159 } \ |
157 } while (false) | 160 } while (false) |
158 | 161 |
159 #endif | 162 #endif |
OLD | NEW |