matlabtest.coder.MEXReplacementTestSuite Class
Namespace: matlabtest.coder
Description
Use the matlabtest.coder.MEXReplacementTestSuite
class to verify generated C/C++ code by creating and
running MEX replacement test suites. These test suites replace calls to MATLAB® functions with calls to MEX functions in existing MATLAB tests. The test contains the tests as matlab.unittest.Test
objects. You can only run the tests programmatically.
Running tests in matlabtest.coder.MEXReplacementTestSuite
test suites is similar to running tests by
using the coder.runTest
(MATLAB Coder) function, but the tests run using
the matlab.unittest
framework and store the results
in matlab.unittest.TestResult
objects.
The matlabtest.coder.MEXReplacementTestSuite
class is a handle
class.
Creation
Create instances of matlabtest.coder.MEXReplacementTestSuite
by using one of the public methods.
Methods
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