blob: 0773f5a31e9627a1ff70d4659e83effc7dbb91de [file] [log] [blame]
reed@android.com80e39a72009-04-02 16:59:40 +00001/* This file is meant to be included by .cpp files, so it can spew out a
reed@android.comd8730ea2009-02-27 22:06:06 +00002 customized class + global definition.
reed@android.com80e39a72009-04-02 16:59:40 +00003
reed@android.comd8730ea2009-02-27 22:06:06 +00004 e.g.
5 #include "TestClassDef.h"
6 DEFINE_TESTCLASS("MyTest", MyTestClass, MyTestFunction)
reed@android.com80e39a72009-04-02 16:59:40 +00007
reed@android.comd8730ea2009-02-27 22:06:06 +00008 where MyTestFunction is declared as
reed@android.com80e39a72009-04-02 16:59:40 +00009
reed@android.comd8730ea2009-02-27 22:06:06 +000010 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