diff options
-rw-r--r-- | tests/AAClipTest.cpp | 6 | ||||
-rw-r--r-- | tests/TestClassDef.h | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/tests/AAClipTest.cpp b/tests/AAClipTest.cpp index e3be006e57..f70cfd679f 100644 --- a/tests/AAClipTest.cpp +++ b/tests/AAClipTest.cpp @@ -394,7 +394,8 @@ static void test_regressions() { } } -static void TestAAClip(skiatest::Reporter* reporter) { +#include "TestClassDef.h" +DEF_TEST(AAClip, reporter) { test_empty(reporter); test_path_bounds(reporter); test_irect(reporter); @@ -403,6 +404,3 @@ static void TestAAClip(skiatest::Reporter* reporter) { test_regressions(); test_nearly_integral(reporter); } - -#include "TestClassDef.h" -DEFINE_TESTCLASS("AAClip", AAClipTestClass, TestAAClip) diff --git a/tests/TestClassDef.h b/tests/TestClassDef.h index 70d6039c16..89124c78fa 100644 --- a/tests/TestClassDef.h +++ b/tests/TestClassDef.h @@ -55,3 +55,15 @@ }; \ static TestRegistry gReg_##classname(classname::Factory); \ } + + +// Yet shorter way to define a test. E.g. +// +// DEF_TEST(some_test_name, r) { +// ... +// REPORTER_ASSERT(r, x == 15); +// } +#define DEF_TEST(name, reporter) \ + static void name(skiatest::Reporter* reporter); \ + DEFINE_TESTCLASS_SHORT(name) \ + static void name(skiatest::Reporter* reporter) |