matlabtest.coder.MEXReplacementTestSuite.fromRequirements
Class: matlabtest.coder.MEXReplacementTestSuite
Namespace: matlabtest.coder
Syntax
Description
creates a MEX replacement test suite from the MATLAB® tests that verify the requirements specified by
suite
= matlabtest.coder.MEXReplacementTestSuite.fromRequirements(requirements
,mexFcn
)requirements
. The tests call the MEX function specified by
mexFcn
.
The method searches only the tests linked to requirements
with the
Verify
link type. For more information about link types, see Create and Store Links (Requirements Toolbox). You must have
Requirements Toolbox™ installed to use this method.
includes only the tests that satisfy the conditions of the specified selector.suite
= matlabtest.coder.MEXReplacementTestSuite.fromRequirements(requirements
,mexFcn
,selector
)
specifies options using one or more name-value arguments in addition to the input argument
combinations in previous syntaxes.suite
= matlabtest.coder.MEXReplacementTestSuite.fromRequirements(___,Name=Value
)
Input Arguments
Name-Value Arguments
Output Arguments
Examples
Alternatives
You can also use the coder.runTest
(MATLAB Coder) function to run existing tests that replace calls to
MATLAB functions with calls to MEX functions. However, the
matlabtest.coder.MEXReplacementTestSuite
class provides these
advantages over the coder.runTest
(MATLAB Coder) function:
You can run tests from multiple test files.
You can collect coverage for the generated C/C++ code.
You can generate test and coverage reports from the results.
You can run MEX replacement test suites on CI platforms.
You can run MEX replacement test suites and MATLAB test suites in the same run by executing a single command.
For more information, see Verify Generated C/C++ Code by Running Existing MATLAB Tests.
Version History
Introduced in R2025a