getTestCase
Class: sltest.testmanager.TestCaseResult
Namespace: sltest.testmanager
Get test case that produced result
Syntax
tc = getTestCase(tcresult)
Description
returns the test case that produced the test case results, tc
= getTestCase(tcresult
)tc
.
Input Arguments
tcresult
— Test case result
sltest.testmanager.TestCaseResult
object
Test case result from a test case run, specified as an sltest.testmanager.TestCaseResult
object.
Output Arguments
tc
— Test case
sltest.testmanager.TestCase
object
Test case that produced the test case results, returned as an sltest.testmanager.TestCase
object.
Examples
Obtain Test Case That Produced Result
This example shows how to create a test file, test suite, and simulation test case programmatically. The test case runs on the HeatPumpScenario
model and uses getTestCase
to obtain the test case that produced the test results.
Clear existing test files from the Test Manager.
sltest.testmanager.clear;
Create test file, test suite, and test case.
tf = sltest.testmanager.TestFile('Test File 1'); ts = createTestSuite(tf,'Test Suite 1'); tc = createTestCase(ts,'simulation','Test Case 1');
Remove default test suite so that only the created test suite is used.
tsDel = tf.getTestSuites(); remove(tsDel(1));
Assign the system under test to the test case, and run the test.
setProperty(tc,'Model','HeatPumpScenario'); tcresult = run(tc);
Obtain the test case results.
tcresultobj = getTestCaseResults(tc);
Obtain the test case that produced the results.
tcobj = getTestCase(tcresultobj);
Version History
Introduced in R2019b
See Also
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)