Main Content

run

Class: sltest.testmanager.TestCase
Package: sltest.testmanager

Run test case

Syntax

resultObj = run(tc)
resultObj = run(tc,"Parallel",setting)

Description

resultObj = run(tc) runs the test case.

resultObj = run(tc,"Parallel",setting) runs test case with or without Parallel Computing Toolbox™ or MATLAB® Parallel Server™.

Input Arguments

expand all

Test case you want to run, specified as an sltest.testmanager.TestCase object.

Whether to run the test case with Parallel Computing Toolbox or MATLAB Parallel Server, specified as either false or true. Requires Parallel Computing Toolbox or MATLAB Parallel Server license, respectively.

Example: run(tc,"Parallel",true)

Data Types: logical

Output Arguments

expand all

Test results, returned as a results set object, sltest.testmanager.ResultSet.

Examples

expand all

Open the model for this example.

openExample('sldemo_autotrans');

Create the test file, test suite, and test case structure.

tf = sltest.testmanager.TestFile("API Test File");
ts = createTestSuite(tf,"API Test Suite");
tc = createTestCase(ts,"simulation","Simulation Test Case");

Remove the default test suite.

tsDel = getTestSuiteByName(tf,"New Test Suite 1");
remove(tsDel);

Assign the system under test to the test case.

setProperty(tc,"Model","sldemo_autotrans");

Run the test case and return the results data.

ro = run(tc);

Open the model for this example.

openExample('sldemo_autotrans');

Create the test file, test suite, and test case structure.

tf = sltest.testmanager.TestFile("API Test File");
ts = createTestSuite(tf,"API Test Suite");
tc = createTestCase(ts,"simulation","Simulation Test Case");

Remove the default test suite.

tsDel = getTestSuiteByName(tf,"New Test Suite 1");
remove(tsDel);

Assign the system under test to the test case.

setProperty(tc,"Model","sldemo_autotrans");

Run the test case with Parallel Computing Toolbox and return the results data.

ro = run(tc,"Parallel",true);

Version History

Introduced in R2015b