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 /* This file is meant to be included by .cpp files, so it can spew out a | 8 /* This file is meant to be included by .cpp files, so it can spew out a |
9 customized class + global definition. | 9 customized class + global definition. |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 public:
\ | 48 public:
\ |
49 static Test* Factory(void*) { return SkNEW(classname); }
\ | 49 static Test* Factory(void*) { return SkNEW(classname); }
\ |
50 protected:
\ | 50 protected:
\ |
51 virtual void onGetName(SkString* name) SK_OVERRIDE { name->set(uinam
e); } \ | 51 virtual void onGetName(SkString* name) SK_OVERRIDE { name->set(uinam
e); } \ |
52 virtual void onRun(Reporter* reporter) SK_OVERRIDE {
\ | 52 virtual void onRun(Reporter* reporter) SK_OVERRIDE {
\ |
53 function(reporter, GetGrContextFactory());
\ | 53 function(reporter, GetGrContextFactory());
\ |
54 }
\ | 54 }
\ |
55 };
\ | 55 };
\ |
56 static TestRegistry gReg_##classname(classname::Factory);
\ | 56 static TestRegistry gReg_##classname(classname::Factory);
\ |
57 } | 57 } |
| 58 |
| 59 |
| 60 // Yet shorter way to define a test. E.g. |
| 61 // |
| 62 // DEF_TEST(some_test_name, r) { |
| 63 // ... |
| 64 // REPORTER_ASSERT(r, x == 15); |
| 65 // } |
| 66 #define DEF_TEST(name, reporter) \ |
| 67 static void name(skiatest::Reporter* reporter); \ |
| 68 DEFINE_TESTCLASS_SHORT(name) \ |
| 69 static void name(skiatest::Reporter* reporter) |
OLD | NEW |