Code covered by the BSD License  

Highlights from
MATLAB xUnit Test Framework

image thumbnail

MATLAB xUnit Test Framework

by

 

31 Jan 2009 (Updated )

MATLAB xUnit is a unit test framework for MATLAB code.

Editor's Notes:

This file was selected as MATLAB Central Pick of the Week

MATLAB xUnit Test Framework: How to Run a Specific Test

MATLAB xUnit Test Framework: How to Run a Specific Test

To run all the test cases in just one M-file, ignoring other test cases that might be in other files in the same directory, give the name of the file (without the ".m" extension) as an argument to runtests.

For example

cd example_subfunction_tests

runtests testFliplr
Starting test run with 2 test cases.
..
PASSED in 0.023 seconds.

To run a single test case, add the name of the test case using a colon (":"), like this:

runtests testFliplr:testFliplrVector
Starting test run with 1 test case.
.
PASSED in 0.001 seconds.

Back to MATLAB xUnit Test Framework

Contact us