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

Side by Side Diff: tests/TestClassDef.h

Issue 138563004: Move macros from TestClassDef.h to Test.h (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: upload Created 6 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « tests/Test.h ('k') | tests/TestSize.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 /*
2 * Copyright 2011 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8 /* This file is meant to be included by .cpp files, so it can spew out a
9 customized class + global definition.
10
11 e.g.
12 #include "TestClassDef.h"
13
14 DEF_TEST(TestName, reporter) {
15 ...
16 REPORTER_ASSERT(reporter, x == 15);
17 }
18 */
19
20 #define DEF_TEST(name, reporter) \
21 static void name(skiatest::Reporter* reporter); \
22 namespace skiatest { \
23 class name##Class : public Test { \
24 public: \
25 static Test* Factory(void*) { return SkNEW(name##Class); } \
26 protected: \
27 virtual void onGetName(SkString* name) SK_OVERRIDE { name->set(#name ); } \
28 virtual void onRun(Reporter* reporter) SK_OVERRIDE { name(reporter); } \
29 }; \
30 static TestRegistry gReg_##name##Class(name##Class::Factory); \
31 } \
32 static void name(skiatest::Reporter* reporter)
33
34 #define DEF_GPUTEST(name, reporter, factory) \
35 static void name(skiatest::Reporter* reporter, GrContextFactory* factory); \
36 namespace skiatest { \
37 class name##Class : public GpuTest { \
38 public: \
39 static Test* Factory(void*) { return SkNEW(name##Class); } \
40 protected: \
41 virtual void onGetName(SkString* name) SK_OVERRIDE { name->set(#name ); } \
42 virtual void onRun(Reporter* reporter) SK_OVERRIDE { \
43 name(reporter, GetGrContextFactory()); \
44 } \
45 }; \
46 static TestRegistry gReg_##name##Class(name##Class::Factory); \
47 } \
48 static void name(skiatest::Reporter* reporter, GrContextFactory* factory)
OLDNEW
« no previous file with comments | « tests/Test.h ('k') | tests/TestSize.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698