Main Content

validateAudioPlugin

Test MATLAB source code for audio plugin

Description

example

validateAudioPlugin classname generates and runs a Test Bench Procedure that exercises your audio plugin class.

example

validateAudioPlugin options classname specifies options to modify the default Test Bench Procedure.

Examples

collapse all

validateAudioPlugin audiopluginexample.Echo
Checking plug-in class 'audiopluginexample.Echo'... passed.
Generating testbench file 'testbench_Echo.m'... done.
Running testbench... passed.
Generating mex file 'testbench_Echo_mex.mexw64'... done.
Running mex testbench... passed.
Deleting testbench.
Ready to generate audio plug-in.
validateAudioPlugin -nomex audiopluginexample.Echo
Checking plug-in class 'audiopluginexample.Echo'... passed.
Generating testbench file 'testbench_Echo.m'... done.
Running testbench... passed.
Skipping mex.
Deleting testbench.
validateAudioPlugin -keeptestbench audiopluginexample.Echo
Checking plug-in class 'audiopluginexample.Echo'... passed.
Generating testbench file 'testbench_Echo.m'... done.
Running testbench... passed.
Generating mex file 'testbench_Echo_mex.mexw64'... done.
Running mex testbench... passed.
Keeping testbench.
Ready to generate audio plug-in.

Two test benches are saved to your current folder:

  • testbench_Echo.m

  • testbench_Echo_mex.mexw64

validateAudioPlugin -keeptestbench -nomex audiopluginexample.Echo
Checking plug-in class 'audiopluginexample.Echo'... passed.
Generating testbench file 'testbench_Echo.m'... done.
Running testbench... passed.
Skipping mex.
Keeping testbench.

One test bench is saved to your current folder:

  • testbench_Echo.m

Input Arguments

collapse all

Options to modify test bench procedure, specified as -nomex, -keeptestbench, or -audioconfig cfg. Options can be specified together or separately, and in any order.

You can also specify these options and validate plugins using the generateAudioPlugin user interface (UI).

Option

generateAudioPlugin UI Setting

Description

-nomexClear the Run a MEX version of the test bench optionDo not generate and run a MEX version of the test bench file. This option significantly reduces run time of the test bench procedure.
-keeptestbenchSave test benches to output folderSave the generated test benches to the current folder. In the generateAudioPlugin UI, the test benches are saved to the folder specified by Output folder.
-audioconfig cfgCoder Configuration section

Specify deep learning and code replacement configuration for coder. See audioPluginConfig for more details

Name of the plugin class to validate. The plugin class must derive from either the audioPlugin class or the audioPluginSource class. The validateAudioPlugin function exercises an instance of the specified plugin class.

You can specify the plugin class to validate by specifying its class name or file name. For example, the following syntaxes perform equivalent operations:

  • validateAudioPlugin myPlugin

  • validateAudioPlugin myPlugin.m

If you want to specify the plugin class by file name, and your plugin class is inside a package, you must specify the package as a file path. For example, the following syntaxes perform equivalent operations:

  • validateAudioPlugin myPluginPackage.myPlugin

  • validateAudioPlugin +myPluginPackage/myPlugin.m

Limitations

The validateAudioPlugin function is compatible with Windows® and Mac operating systems. It is not compatible with Linux®.

More About

collapse all

Test Bench Procedure

The validateAudioPlugin function uses dynamic testing to find common audio plugin programming mistakes not found by the static checks performed by generateAudioPlugin. The function:

  1. Runs a subset of error checks performed by generateAudioPlugin.

  2. Generates and runs a MATLAB® test bench to exercise the class.

  3. Generates and runs a MEX version of the test bench.

  4. Removes the generated test benches.

If the plugin class fails testing, step 4 is automatically omitted. To debug your plugin, step through the saved generated test bench.

If you use the -keeptestbench option, or if an error occurs during validation, the test bench files are saved to your current folder.

Output File Name

Output File Type

Output File Name With File Extension

testbench_myClassName

MATLAB

testbench_myClassName.m

testbench_myClassName_mex

MEX

testbench_myClassName_mex.mexw64

The MEX-file extension depends on your operating system.

Version History

Introduced in R2016a