Skip to content

mathworks/test-framework-extensions

Repository files navigation

Test Framework Extensions Toolbox

View Test Framework Extensions Toolbox on File Exchange Open in MATLAB Online

The Test Framework Extensions toolbox provides a number of custom constraints and fixtures to aid the testing of MATLAB code.

Constraints

  • 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 of string, char, or cellstr type.
  • 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.

Fixtures

  • 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.

Installation and Getting Started

  1. Test Framework Extensions is provided as a MATLAB Toolbox. Download the toolbox file (TestFrameworkExtensions.mltbx).
  2. Double-click on the file TestFrameworkExtensions.mltbx to install it.
  3. Complete the installation process.
  4. Verify the toolbox installation by entering >> ver testframeworkextensions at the MATLAB command line.

MathWorks Product Requirements

Test Framework Extensions is compatible with R2023b and later versions.

License

The license is available in the LICENSE.txt file in this GitHub repository.

Community Support

MATLAB Central

Copyright 2026 The MathWorks, Inc.

About

The Test Framework Extensions toolbox provides custom constraints and fixtures to aid the testing of MATLAB code.

Resources

License

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages