getTestCaseResults
类: sltest.testmanager.TestCase
命名空间: sltest.testmanager
语法
tcresult = getTestCaseResults(tc)
输入参数
tc
— 测试用例
sltest.testmanager.TestCase
对象
要获取结果历史记录的测试用例,指定为 sltest.testmanager.TestCase
对象。
输出参量
tcresult
— 测试用例结果历史记录
sltest.testmanager.TestCaseResult
对象数组
测试用例结果历史记录,以 sltest.testmanager.TestCaseResult
对象数组的形式返回。数组中的每个对象包含单个测试用例运行的结果。
示例
获取测试用例结果
此示例展示如何以编程方式创建测试文件、测试套件和仿真测试用例。它还展示了如何获得结果。测试用例在 HeatPumpScenario
模型上运行。
从测试管理器中清除现有的测试文件。
sltest.testmanager.clear;
创建一个新的测试文件、测试套件和测试用例。
tf = sltest.testmanager.TestFile('TestFile1'); ts = createTestSuite(tf,'TestSuite1'); tc = createTestCase(ts,'simulation','TestCase1');
删除默认测试套件,以便仅使用创建的测试套件。
tsDel = tf.getTestSuites(); remove(tsDel(1));
将在测系统分配给测试用例。
setProperty(tc,'Model','HeatPumpScenario'); tcresult = run(tc);
获取测试用例结果
tcresultobj = getTestCaseResults(tc);
版本历史记录
在 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)