The Test Framework Extensions toolbox provides a number of custom constraints and fixtures to aid the testing of MATLAB code.
DatetimeTolerance- allow non-exact matching of datetimes and durations.HasStringLengthLessThan- check that string length is less than a set value.IsEqualVector- are two vectors equal irrespective of row or column orientation.IsEquivalentText- is text equal irrespective ofstring,char, orcellstrtype.IsSamePathAs- are paths equal irrespective of data type, file separator, and (Windows) capitalization.MatchesStatistically- are at least a certain percentage of elements equal within a tolerance.NotifiesEvent- check that a function or method call notifies an event.NotifiesPropertyEvent- check that a function or method call notifies a property event.PassesEventData- check that a function or method call notifies an event with custom event data.
FigureFixture- create a figure and close it on teardown.PreferenceFixture- override a MATLAB preference and restore it on teardown.SimulinkModelFixture- load a Simulink model and close it on teardown.SuppressParpoolAutocreateFixture- suppress the automatic creation of parpools and restore the original setting in teardown.
The documentation provides examples of how to use these constraints and fixtures.
See also the database testing framework.
- Test Framework Extensions is provided as a MATLAB Toolbox. Download the toolbox file (
TestFrameworkExtensions.mltbx). - Double-click on the file
TestFrameworkExtensions.mltbxto install it. - Complete the installation process.
- Verify the toolbox installation by entering
>> ver testframeworkextensionsat the MATLAB command line.
MathWorks Product Requirements
Test Framework Extensions is compatible with R2023b and later versions.
- MATLAB®
- The
SimulinkModelFixturerequires Simulink®. - Usually, you will use the
SuppressParpoolAutocreateFixturewith Parallel Computing Toolbox™.
The license is available in the LICENSE.txt file in this GitHub repository.
Copyright 2026 The MathWorks, Inc.