Skip to Main Content Skip to Search
Product Documentation

Running Tests from the MATLAB Command Line

You can run one or more SystemTest tests from the MATLAB command line, using the strun function. This is useful for running multiple test files as a batch or calling a test file as part of a MATLAB file.

The function takes the name of your test file as a string. The test file must be on the MATLAB path, or you can specify the full path in the string.

For example, to run a test called mytest that is on the MATLAB path, use this syntax:

strun('mytest')

To run a test called mytest that is not on the MATLAB path, but is in a local directory called c:\work, use this syntax:

strun('c:\work\mytest.test')

To run multiple tests, use a cell array of strings, as follows:

strun({'mytest' 'mytest2'})

If the SystemTest desktop is open when strun is called, strun leaves it open. Otherwise, strun closes the desktop after the test runs.

For more information, see strun.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS