createTestCase

Class: sltest.testmanager.TestSuite
Package: sltest.testmanager

Create test case

Syntax

tc = createTestCase(ts,type,name,runOnTarget)

Description

tc = createTestCase(ts,type,name,runOnTarget) creates a new test case within the test suite. You can specify the test case name and type: baseline, equivalence, and simulation. Also, if you are using the test case for real-time testing, you can specify this using the runOnTarget argument.

Input Arguments

expand all

Test suite that you want to add a test case to, specified as an sltest.testmanager.TestSuite object.

Test case type, specified as a character vector.

Test case name, specified as a character vector. If this input argument is empty, then the Test Manager gives the test case a unique name.

Specify if you want to run the test case simulation on a target, specified as a cell array of Booleans. This is an optional argument. For more information on real-time testing, see Test Models in Real Time.

Output Arguments

expand all

Test case, returned as an sltest.testmanager.TestCase object.

Examples

expand all

% Create test file
tf = sltest.testmanager.TestFile('C:\MATLAB\test_file.mldatx');

% Create test suite
ts = sltest.testmanager.TestSuite(tf,'My Test Suite');

% Create test case
tc = createTestCase(ts,'baseline','My Baseline Test')

Introduced in R2015b