2011-07-28 14:26:00 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Copyright 2011 Google Inc.
|
|
|
|
*
|
|
|
|
* Use of this source code is governed by a BSD-style license that can be
|
|
|
|
* found in the LICENSE file.
|
|
|
|
*/
|
2009-04-02 16:59:40 +00:00
|
|
|
/* This file is meant to be included by .cpp files, so it can spew out a
|
2009-02-27 22:06:06 +00:00
|
|
|
customized class + global definition.
|
2009-04-02 16:59:40 +00:00
|
|
|
|
2009-02-27 22:06:06 +00:00
|
|
|
e.g.
|
|
|
|
#include "TestClassDef.h"
|
|
|
|
DEFINE_TESTCLASS("MyTest", MyTestClass, MyTestFunction)
|
2009-04-02 16:59:40 +00:00
|
|
|
|
2009-02-27 22:06:06 +00:00
|
|
|
where MyTestFunction is declared as
|
2009-04-02 16:59:40 +00:00
|
|
|
|
2009-02-27 22:06:06 +00:00
|
|
|
void MyTestFunction(skiatest::Reporter*)
|
|
|
|
*/
|
|
|
|
|
2013-02-04 16:13:32 +00:00
|
|
|
#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) SK_OVERRIDE { name->set(uiname); } \
|
|
|
|
virtual void onRun(Reporter* reporter) SK_OVERRIDE { function(reporter); } \
|
|
|
|
}; \
|
|
|
|
static TestRegistry gReg(classname::Factory); \
|
2009-02-27 22:06:06 +00:00
|
|
|
}
|
|
|
|
|
2013-02-04 16:13:32 +00:00
|
|
|
#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) SK_OVERRIDE { name->set(uiname); } \
|
|
|
|
virtual void onRun(Reporter* reporter) SK_OVERRIDE { \
|
|
|
|
function(reporter, GetGrContextFactory()); \
|
|
|
|
} \
|
|
|
|
}; \
|
|
|
|
static TestRegistry gReg(classname::Factory); \
|
2011-08-16 15:45:58 +00:00
|
|
|
}
|