• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*  This file is meant to be included by .cpp files, so it can spew out a
2     customized class + global definition.
3 
4     e.g.
5     #include "TestClassDef.h"
6     DEFINE_TESTCLASS("MyTest", MyTestClass, MyTestFunction)
7 
8     where MyTestFunction is declared as
9 
10         void MyTestFunction(skiatest::Reporter*)
11 */
12 
13 #define DEFINE_TESTCLASS(uiname, classname, function)                       \
14     namespace skiatest {                                                    \
15         class classname : public Test {                                     \
16         public:                                                             \
17             static Test* Factory(void*) { return SkNEW(classname); }        \
18         protected:                                                          \
19             virtual void onGetName(SkString* name) { name->set(uiname); }   \
20             virtual void onRun(Reporter* reporter) { function(reporter); }  \
21         };                                                                  \
22         static TestRegistry gReg(classname::Factory);                       \
23     }
24 
25