Main Content


Class: sltest.testmanager.TestCase
Namespace: sltest.testmanager

Get test case results history

Since R2019b


tcresult = getTestCaseResults(tc)


tcresult = getTestCaseResults(tc) returns the test case results history for the specified test case, tc. The test case history includes the results for all runs of the test case in the Test Manager.

Input Arguments

expand all

Test case for which to obtain result history, specified as an sltest.testmanager.TestCase object.

Output Arguments

expand all

Test case result history, returned as an array of sltest.testmanager.TestCaseResult objects. Each object in the array contains the results for a single test case run.


expand all

This example shows how to create a test file, test suite, and simulation test case programmatically. It also show how to obtain the results. The test case runs on the HeatPumpScenario model.

Clear existing test files from the Test Manager.


Create a new test file, test suite, and test case.

tf = sltest.testmanager.TestFile('TestFile1');
ts = createTestSuite(tf,'TestSuite1');
tc = createTestCase(ts,'simulation','TestCase1');

Remove the default test suite so that only the created test suite is used.

tsDel = tf.getTestSuites();

Assign the system under test to the test case.

tcresult = run(tc);

Obtain the test case results

tcresultobj = getTestCaseResults(tc);

Version History

Introduced in R2019b

See Also