more tests (need more meat in there)
git-svn-id: http://skia.googlecode.com/svn/trunk@97 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/tests/TestClassDef.h b/tests/TestClassDef.h
new file mode 100644
index 0000000..77f48b3
--- /dev/null
+++ b/tests/TestClassDef.h
@@ -0,0 +1,24 @@
+/* This file is meant be including by .cpp files, so it can spew out a
+ customized class + global definition.
+
+ e.g.
+ #include "TestClassDef.h"
+ DEFINE_TESTCLASS("MyTest", MyTestClass, MyTestFunction)
+
+ where MyTestFunction is declared as
+
+ void MyTestFunction(skiatest::Reporter*)
+*/
+
+#define DEFINE_TESTCLASS(uiname, classname, function) \
+ namespace skiatest { \
+ class classname : public Test { \
+ public: \
+ static Test* Factory(void*) { return SkNEW(classname); } \
+ protected: \
+ virtual void onGetName(SkString* name) { name->set(uiname); } \
+ virtual void onRun(Reporter* reporter) { function(reporter); } \
+ }; \
+ static TestRegistry gReg(classname::Factory); \
+ }
+