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

For example

cd example_subfunction_tests

runxunit testFliplr
Test suite: testFliplr
Test suite location: C:\Users\psexton\Documents\GitHub\matlab-xunit-doctest\doc\example_subfunction_tests\testFliplr.m
20-Feb-2014 19:59:07

Starting test run with 2 test cases.
..
PASSED in 0.003 seconds.

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

runxunit testFliplr:testFliplrVector
Test suite: testFliplr
Test suite location: C:\Users\psexton\Documents\GitHub\matlab-xunit-doctest\doc\example_subfunction_tests\testFliplr.m
20-Feb-2014 19:59:07

Starting test run with 1 test case.
.
PASSED in 0.001 seconds.

Back to MATLAB xUnit Test Framework