| 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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 if (!(cond)) { \ | 99 if (!(cond)) { \ |
| 100 REPORT_FAILURE(r, #cond, SkString(message)); \ | 100 REPORT_FAILURE(r, #cond, SkString(message)); \ |
| 101 } \ | 101 } \ |
| 102 } while (0) | 102 } while (0) |
| 103 | 103 |
| 104 #define ERRORF(r, ...) \ | 104 #define ERRORF(r, ...) \ |
| 105 do { \ | 105 do { \ |
| 106 REPORT_FAILURE(r, "", SkStringPrintf(__VA_ARGS__)); \ | 106 REPORT_FAILURE(r, "", SkStringPrintf(__VA_ARGS__)); \ |
| 107 } while (0) | 107 } while (0) |
| 108 | 108 |
| 109 #define INFOF(REPORTER, ...) \ |
| 110 do { \ |
| 111 if ((REPORTER)->verbose()) { \ |
| 112 SkDebugf(__VA_ARGS__); \ |
| 113 } \ |
| 114 } while (0) |
| 115 |
| 109 #define DEF_TEST(name, reporter) \ | 116 #define DEF_TEST(name, reporter) \ |
| 110 static void test_##name(skiatest::Reporter*, GrContextFactory*); \ | 117 static void test_##name(skiatest::Reporter*, GrContextFactory*); \ |
| 111 skiatest::TestRegistry name##TestRegistry( \ | 118 skiatest::TestRegistry name##TestRegistry( \ |
| 112 skiatest::Test(#name, false, test_##name)); \ | 119 skiatest::Test(#name, false, test_##name)); \ |
| 113 void test_##name(skiatest::Reporter* reporter, GrContextFactory*) | 120 void test_##name(skiatest::Reporter* reporter, GrContextFactory*) |
| 114 | 121 |
| 115 #define GPUTEST_EXPAND_MSVC(x) x | 122 #define GPUTEST_EXPAND_MSVC(x) x |
| 116 #define GPUTEST_APPLY(C, ...) GPUTEST_EXPAND_MSVC(C(__VA_ARGS__)) | 123 #define GPUTEST_APPLY(C, ...) GPUTEST_EXPAND_MSVC(C(__VA_ARGS__)) |
| 117 #define GPUTEST_SELECT(a1, a2, N, ...) N | 124 #define GPUTEST_SELECT(a1, a2, N, ...) N |
| 118 | 125 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 145 #define DEF_GPUTEST_FOR_NULL_CONTEXT(name, reporter, ...) \ | 152 #define DEF_GPUTEST_FOR_NULL_CONTEXT(name, reporter, ...) \ |
| 146 DEF_GPUTEST_FOR_CONTEXTS(name, skiatest::kNull_GPUTestContexts, reporter
, __VA_ARGS__) | 153 DEF_GPUTEST_FOR_CONTEXTS(name, skiatest::kNull_GPUTestContexts, reporter
, __VA_ARGS__) |
| 147 #define DEF_GPUTEST_FOR_NATIVE_CONTEXT(name, reporter, ...) \ | 154 #define DEF_GPUTEST_FOR_NATIVE_CONTEXT(name, reporter, ...) \ |
| 148 DEF_GPUTEST_FOR_CONTEXTS(name, skiatest::kNative_GPUTestContexts, report
er, __VA_ARGS__) | 155 DEF_GPUTEST_FOR_CONTEXTS(name, skiatest::kNative_GPUTestContexts, report
er, __VA_ARGS__) |
| 149 | 156 |
| 150 #define REQUIRE_PDF_DOCUMENT(TEST_NAME, REPORTER) \ | 157 #define REQUIRE_PDF_DOCUMENT(TEST_NAME, REPORTER) \ |
| 151 do { \ | 158 do { \ |
| 152 SkDynamicMemoryWStream testStream; \ | 159 SkDynamicMemoryWStream testStream; \ |
| 153 SkAutoTUnref<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \ | 160 SkAutoTUnref<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \ |
| 154 if (!testDoc) { \ | 161 if (!testDoc) { \ |
| 155 if ((REPORTER) && (REPORTER)->verbose()) { \ | 162 INFOF(REPORTER, "PDF disabled; %s test skipped.", #TEST_NAME); \ |
| 156 SkDebugf("PDF disabled; %s test skipped.", #TEST_NAME); \ | |
| 157 } \ | |
| 158 return; \ | 163 return; \ |
| 159 } \ | 164 } \ |
| 160 } while (false) | 165 } while (false) |
| 161 | 166 |
| 162 #endif | 167 #endif |
| OLD | NEW |