aboutsummaryrefslogtreecommitdiffstats
path: root/tests/TestClassDef.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/TestClassDef.h')
-rw-r--r--tests/TestClassDef.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/TestClassDef.h b/tests/TestClassDef.h
index 0773f5a..ffef2a1 100644
--- a/tests/TestClassDef.h
+++ b/tests/TestClassDef.h
@@ -1,3 +1,10 @@
+
+/*
+ * Copyright 2011 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
/* This file is meant to be included by .cpp files, so it can spew out a
customized class + global definition.
@@ -22,3 +29,18 @@
static TestRegistry gReg(classname::Factory); \
}
+#define DEFINE_GPUTESTCLASS(uiname, classname, function) \
+ namespace skiatest { \
+ class classname : public GpuTest { \
+ public: \
+ static Test* Factory(void*) { return SkNEW(classname); } \
+ protected: \
+ virtual void onGetName(SkString* name) { name->set(uiname); } \
+ virtual void onRun(Reporter* reporter) { \
+ if (fContext) { \
+ function(reporter, fContext); \
+ } \
+ } \
+ }; \
+ static TestRegistry gReg(classname::Factory); \
+ }