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

Side by Side Diff: tests/Test.h

Issue 345753007: Preprend Test to test function name generated by DEF_TEST() macro. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 6 years, 6 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/SkBase64Test.cpp ('k') | tests/UnitTestTest.cpp » ('j') | 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 /* 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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } while(0) 131 } while(0)
132 132
133 #define ERRORF(reporter, ...) \ 133 #define ERRORF(reporter, ...) \
134 do { \ 134 do { \
135 SkString desc; \ 135 SkString desc; \
136 desc.printf("%s:%d\t", __FILE__, __LINE__); \ 136 desc.printf("%s:%d\t", __FILE__, __LINE__); \
137 desc.appendf(__VA_ARGS__) ; \ 137 desc.appendf(__VA_ARGS__) ; \
138 (reporter)->reportFailed(desc); \ 138 (reporter)->reportFailed(desc); \
139 } while(0) 139 } while(0)
140 140
141 #define DEF_TEST(name, reporter) \ 141 #define DEF_TEST(name, reporter) \
142 static void name(skiatest::Reporter*); \ 142 static void Test##name(skiatest::Reporter*); \
mtklein 2014/06/23 17:18:21 Let's do test_##name to match the style guide for
tfarina 2014/06/23 22:47:32 Done.
143 namespace skiatest { \ 143 namespace skiatest { \
144 class name##Class : public Test { \ 144 class name##Class : public Test { \
145 public: \ 145 public: \
146 static Test* Factory(void*) { return SkNEW(name##Class); } \ 146 static Test* Factory(void*) { return SkNEW(name##Class); } \
147 protected: \ 147 protected: \
148 virtual void onGetName(SkString* name) SK_OVERRIDE { \ 148 virtual void onGetName(SkString* name) SK_OVERRIDE { \
149 name->set(#name); \ 149 name->set(#name); \
150 } \ 150 } \
151 virtual void onRun(Reporter* r) SK_OVERRIDE { name(r); } \ 151 virtual void onRun(Reporter* r) SK_OVERRIDE { Test##name(r); } \
152 }; \ 152 }; \
153 static TestRegistry gReg_##name##Class(name##Class::Factory); \ 153 static TestRegistry gReg_##name##Class(name##Class::Factory); \
154 } \ 154 } \
155 static void name(skiatest::Reporter* reporter) 155 static void Test##name(skiatest::Reporter* reporter)
156 156
157 #define DEF_GPUTEST(name, reporter, factory) \ 157 #define DEF_GPUTEST(name, reporter, factory) \
158 static void name(skiatest::Reporter*, GrContextFactory*); \ 158 static void Test##name(skiatest::Reporter*, GrContextFactory*); \
159 namespace skiatest { \ 159 namespace skiatest { \
160 class name##Class : public GpuTest { \ 160 class name##Class : public GpuTest { \
161 public: \ 161 public: \
162 static Test* Factory(void*) { return SkNEW(name##Class); } \ 162 static Test* Factory(void*) { return SkNEW(name##Class); } \
163 protected: \ 163 protected: \
164 virtual void onGetName(SkString* name) SK_OVERRIDE { \ 164 virtual void onGetName(SkString* name) SK_OVERRIDE { \
165 name->set(#name); \ 165 name->set(#name); \
166 } \ 166 } \
167 virtual void onRun(Reporter* r) SK_OVERRIDE { \ 167 virtual void onRun(Reporter* r) SK_OVERRIDE { \
168 name(r, fGrContextFactory); \ 168 Test##name(r, fGrContextFactory); \
169 } \ 169 } \
170 }; \ 170 }; \
171 static TestRegistry gReg_##name##Class(name##Class::Factory); \ 171 static TestRegistry gReg_##name##Class(name##Class::Factory); \
172 } \ 172 } \
173 static void name(skiatest::Reporter* reporter, GrContextFactory* factory) 173 static void Test##name(skiatest::Reporter* reporter, GrContextFactory* facto ry)
174 174
175 #endif 175 #endif
OLDNEW
« no previous file with comments | « tests/SkBase64Test.cpp ('k') | tests/UnitTestTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698