Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(78)

Side by Side Diff: tests/Test.h

Issue 1873313002: Convert some unit tests from running on GL contexts to running on all contexts (Closed) Base URL: https://skia.googlesource.com/skia.git@vkcfg
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/TessellatingPathRendererTests.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef skiatest_Test_DEFINED 7 #ifndef skiatest_Test_DEFINED
8 #define skiatest_Test_DEFINED 8 #define skiatest_Test_DEFINED
9 9
10 #include "SkString.h" 10 #include "SkString.h"
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 skiatest::Test(#name, false, test_##name)); \ 149 skiatest::Test(#name, false, test_##name)); \
150 void test_##name(skiatest::Reporter* reporter, sk_gpu_test::GrContextFactory *) 150 void test_##name(skiatest::Reporter* reporter, sk_gpu_test::GrContextFactory *)
151 151
152 152
153 #define DEF_GPUTEST(name, reporter, factory) \ 153 #define DEF_GPUTEST(name, reporter, factory) \
154 static void test_##name(skiatest::Reporter*, sk_gpu_test::GrContextFactory*) ; \ 154 static void test_##name(skiatest::Reporter*, sk_gpu_test::GrContextFactory*) ; \
155 skiatest::TestRegistry name##TestRegistry( \ 155 skiatest::TestRegistry name##TestRegistry( \
156 skiatest::Test(#name, true, test_##name)); \ 156 skiatest::Test(#name, true, test_##name)); \
157 void test_##name(skiatest::Reporter* reporter, sk_gpu_test::GrContextFactory * factory) 157 void test_##name(skiatest::Reporter* reporter, sk_gpu_test::GrContextFactory * factory)
158 158
159 #define DEF_GPUTEST_FOR_CONTEXTS(name, contexts, reporter, context_info) \ 159 #define DEF_GPUTEST_FOR_CONTEXTS(name, context_filter, reporter, context_info) \
160 static void test_##name(skiatest::Reporter*, \ 160 static void test_##name(skiatest::Reporter*, \
161 const sk_gpu_test::ContextInfo& context_info); \ 161 const sk_gpu_test::ContextInfo& context_info); \
162 static void test_gpu_contexts_##name(skiatest::Reporter* reporter, \ 162 static void test_gpu_contexts_##name(skiatest::Reporter* reporter, \
163 sk_gpu_test::GrContextFactory* factory) { \ 163 sk_gpu_test::GrContextFactory* factory) { \
164 skiatest::RunWithGPUTestContexts(test_##name, contexts, reporter, factor y); \ 164 skiatest::RunWithGPUTestContexts(test_##name, context_filter, reporter, factory); \
165 } \ 165 } \
166 skiatest::TestRegistry name##TestRegistry( \ 166 skiatest::TestRegistry name##TestRegistry( \
167 skiatest::Test(#name, true, test_gpu_contexts_##name)); \ 167 skiatest::Test(#name, true, test_gpu_contexts_##name)); \
168 void test_##name(skiatest::Reporter* reporter, \ 168 void test_##name(skiatest::Reporter* reporter, \
169 const sk_gpu_test::ContextInfo& context_info) 169 const sk_gpu_test::ContextInfo& context_info)
170 170
171 #define DEF_GPUTEST_FOR_ALL_CONTEXTS(name, reporter, context_info) \
172 DEF_GPUTEST_FOR_CONTEXTS(name, nullptr, reporter, context_info)
171 #define DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(name, reporter, context_info) \ 173 #define DEF_GPUTEST_FOR_ALL_GL_CONTEXTS(name, reporter, context_info) \
172 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsGLContextType, reporter, con text_info) 174 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsGLContextType, reporter, con text_info)
173 #define DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(name, reporter, context_info) \ 175 #define DEF_GPUTEST_FOR_GL_RENDERING_CONTEXTS(name, reporter, context_info) \
174 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsRenderingGLContextType, repo rter, context_info) 176 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsRenderingGLContextType, repo rter, context_info)
175 #define DEF_GPUTEST_FOR_NULLGL_CONTEXT(name, reporter, context_info) \ 177 #define DEF_GPUTEST_FOR_NULLGL_CONTEXT(name, reporter, context_info) \
176 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsNullGLContextType, reporter, context_info) 178 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsNullGLContextType, reporter, context_info)
177 #define DEF_GPUTEST_FOR_VULKAN_CONTEXT(name, reporter, context_info) \ 179 #define DEF_GPUTEST_FOR_VULKAN_CONTEXT(name, reporter, context_info) \
178 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsVulkanContextType, reporter, context_info) 180 DEF_GPUTEST_FOR_CONTEXTS(name, &skiatest::IsVulkanContextType, reporter, context_info)
179 181
180 #define REQUIRE_PDF_DOCUMENT(TEST_NAME, REPORTER) \ 182 #define REQUIRE_PDF_DOCUMENT(TEST_NAME, REPORTER) \
181 do { \ 183 do { \
182 SkDynamicMemoryWStream testStream; \ 184 SkDynamicMemoryWStream testStream; \
183 SkAutoTUnref<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \ 185 SkAutoTUnref<SkDocument> testDoc(SkDocument::CreatePDF(&testStream)); \
184 if (!testDoc) { \ 186 if (!testDoc) { \
185 INFOF(REPORTER, "PDF disabled; %s test skipped.", #TEST_NAME); \ 187 INFOF(REPORTER, "PDF disabled; %s test skipped.", #TEST_NAME); \
186 return; \ 188 return; \
187 } \ 189 } \
188 } while (false) 190 } while (false)
189 191
190 #endif 192 #endif
OLDNEW
« no previous file with comments | « tests/TessellatingPathRendererTests.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698