getTestCase
类: sltest.testmanager.TestCaseResult
命名空间: sltest.testmanager
语法
tc = getTestCase(tcresult)
输入参数
tcresult
— 测试用例结果
sltest.testmanager.TestCaseResult
对象
测试用例运行的测试用例结果,指定为 sltest.testmanager.TestCaseResult
对象。
输出参量
tc
— 测试用例
sltest.testmanager.TestCase
对象
产生测试用例结果的测试用例,以 sltest.testmanager.TestCase
对象的形式返回。
示例
获取产生结果的测试用例
此示例展示如何以编程方式创建测试文件、测试套件和仿真测试用例。该测试用例在 HeatPumpScenario
模型上运行,并使用 getTestCase
获取产生测试结果的测试用例。
从测试管理器中清除现有的测试文件。
sltest.testmanager.clear;
创建测试文件、测试套件和测试用例。
tf = sltest.testmanager.TestFile('Test File 1'); ts = createTestSuite(tf,'Test Suite 1'); tc = createTestCase(ts,'simulation','Test Case 1');
删除默认测试套件,以便仅使用创建的测试套件。
tsDel = tf.getTestSuites(); remove(tsDel(1));
将在测系统分配给测试用例,并运行测试。
setProperty(tc,'Model','HeatPumpScenario'); tcresult = run(tc);
获取测试用例结果。
tcresultobj = getTestCaseResults(tc);
获取产生结果的测试用例。
tcobj = getTestCase(tcresultobj);
版本历史记录
在 R2019b 中推出
MATLAB 命令
您点击的链接对应于以下 MATLAB 命令:
请在 MATLAB 命令行窗口中直接输入以执行命令。Web 浏览器不支持 MATLAB 命令。
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)