blob: 77f48b3b46d61f0169ac11d0bafd3e626b53a56f [file] [log] [blame]
reed@android.comd8730ea2009-02-27 22:06:06 +00001/* This file is meant be including 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