VST 3 SDK VST 3.7
SDK for developing VST plug-in
to use the validator to run your own tests?

It is possible to run your own tests when the validator checks your plug-in.

First you have to register a test factory in your plugin factory:

DEF_CLASS2 (Your Plugin Processor)
DEF_CLASS2 (Your Plugin Controller)
DEF_CLASS2 (INLINE_UID_FROM_FUID (getTestFactoryUID ()), PClassInfo::kManyInstances, kTestClass,
"Test Factory", 0, "", "", "", createTestFactoryInstance)
#define DEF_CLASS2(cid, cardinality, category, name, classFlags, subCategories, version, sdkVersion, createMethod)
Definition: pluginfactory.h:159
#define END_FACTORY
Definition: pluginfactory.h:171
#define BEGIN_FACTORY_DEF(vendor, url, email)
Controller
MPE per note controller enumeration.
Definition: mpeprocessor.h:57
const FUID & getTestFactoryUID()
get the test factory class ID
FUnknown * createTestFactoryInstance(void *)
create a Test Factory instance

Second: write your tests:

#include "public.sdk/source/main/moduleinit.h"
static ModuleInitializer InitMyTests ([] () {
registerTest ("MyTests", STR ("two plus two is four"), [] (ITestResult* testResult) {
auto result = 2 + 2;
if (result == 4)
return true;
testResult->addErrorMessage (STR ("Unexpected universe change where 2+2 != 4."));
return false;
});
});
virtual void addErrorMessage(const char *msg)=0
void registerTest(FIDString name, const char *desc, const TestFunc &func)
register a simple test function

If you need access to your audio effect or edit controller you can write your tests as done in the adelay example:

#include "public.sdk/source/main/moduleinit.h"
static ModuleInitializer InitMyTests ([] () {
registerTest ("MyTests", STR ("check one two three"), [] (FUnknown* context, ITestResult*
testResult)
{
if (auto plugProvider = U::cast<ITestPlugProvider> (context))
{
auto controller = plugProvider->getController ();
auto testController = U::cast<IDelayTestController> (controller);
if (!controller)
{
testResult->addErrorMessage (String ("Unknown IEditController"));
return false;
}
bool result = testController->doTest ();
plugProvider->releasePlugIn (nullptr, controller);
return (result);
}
return false;
});
});

After that recompile and if the validator does not run automatically after every build, start the validator manually and let it check your plug-in.

Empty

Copyright © Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.