OLD | NEW |
| (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) | |
OLD | NEW |