VST 3 SDK  VST 3.7
SDK for developing VST plug-in
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Macros Groups Pages
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)
END_FACTORY

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;
});
});

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)
{
FUnknownPtr<ITestPlugProvider> plugProvider (context);
if (plugProvider)
{
auto controller = plugProvider->getController ();
FUnknownPtr<IDelayTestController> testController (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 ©2024 Steinberg Media Technologies GmbH. All Rights Reserved. This documentation is under this license.