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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 skiatest::TestRegistry name##TestRegistry( \ | 95 skiatest::TestRegistry name##TestRegistry( \ |
96 skiatest::Test(#name, false, test_##name)); \ | 96 skiatest::Test(#name, false, test_##name)); \ |
97 void test_##name(skiatest::Reporter* reporter, GrContextFactory*) | 97 void test_##name(skiatest::Reporter* reporter, GrContextFactory*) |
98 | 98 |
99 #define DEF_GPUTEST(name, reporter, factory) \ | 99 #define DEF_GPUTEST(name, reporter, factory) \ |
100 static void test_##name(skiatest::Reporter*, GrContextFactory*); \ | 100 static void test_##name(skiatest::Reporter*, GrContextFactory*); \ |
101 skiatest::TestRegistry name##TestRegistry( \ | 101 skiatest::TestRegistry name##TestRegistry( \ |
102 skiatest::Test(#name, true, test_##name)); \ | 102 skiatest::Test(#name, true, test_##name)); \ |
103 void test_##name(skiatest::Reporter* reporter, GrContextFactory* factory) | 103 void test_##name(skiatest::Reporter* reporter, GrContextFactory* factory) |
104 | 104 |
| 105 #define REQUIRE_PDF_DOCUMENT(TEST_NAME, REPORTER) \ |
| 106 do { \ |
| 107 SkDynamicMemoryWStream testStream; \ |
| 108 SkAutoTUnref<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \ |
| 109 if (!testDoc) { \ |
| 110 if ((REPORTER) && (REPORTER)->verbose()) { \ |
| 111 SkDebugf("PDF disabled; %s test skipped.", #TEST_NAME); \ |
| 112 } \ |
| 113 return; \ |
| 114 } \ |
| 115 } while (false) |
| 116 |
105 #endif | 117 #endif |
OLD | NEW |