matlabtest.coder.MEXReplacementTestSuite.fromMethod
Class: matlabtest.coder.MEXReplacementTestSuite
Namespace: matlabtest.coder
Syntax
Description
creates a MEX replacement test suite from the MATLAB® test specified by suite
= matlabtest.coder.MEXReplacementTestSuite.fromMethod(testClass
,testMethod
,mexFcn
)testMethod
, defined as a method in the
test class specified by testClass
. The test calls the MEX function
specified by mexFcn
.
includes only the tests that satisfy the conditions of the specified selector.suite
= matlabtest.coder.MEXReplacementTestSuite.fromMethod(testClass
,testMethod
,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.fromMethod(___,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