Main Content

测试脚本

自定义测试环境,自动化测试

你可以使用金宝app®test™programmatic接口:

  • 创建测试脚本和函数。

  • 从命令行运行测试。

  • 设置并标准化您的测试环境。

You can use scripts and functions to repeat the same test strategy on multiple systems, or perform regression testing. These functions and classes cover test authoring, execution, and results in金宝appSimulink测试。如果要将现有的Simulink测试与MATLAB结合起来金宝app®使用持续集成测试或运行测试,使用MATLAB单元测试框架。看持续集成

金宝appSimulink测试提供图形用户界面,以帮助您创建和运行测试。有关更多信息,请参阅测试创作测试Execution, 和报告和测试管理

职能

展开全部

测试文件

sltest.testmanager.TestFile 创建或修改测试文件
sltest.testManager.Testsuite. 创建或修改测试套件
sltest.testManager.TestCase. Create or modify test case
sltest.testManager.createTestForComponent. 为模型或模型组件创建测试用例和测试线束
sltest.testmanager.createTestsfrommodel. 从模型生成测试用例
sltest.testmanager.copytests. Copy test cases or test suites to another location
sltest.testmanager.movetests. Move test cases or test suites to a new location
sltest.testmanager.load. 加载测试文件金宝app测试经理
sltest.testmanager.getttestfiles. 在测试管理器中打开测试文件
sltest.testManager.clear.Clear. Clear test files from the Test Manager

输入

sltest.testManager.TestInput. 添加或修改测试输入
sltest.import.sldvdata. Create test cases from金宝app设计验证者结果
sltest.io.金宝appsimulinktestspreadsheet. 以格式读取电子表格金宝app测试

产出

sltest.testManager.BaselineCriteria. Add or modify baseline criteria
sltest.testmanager.EquivalenceCriteria 添加或修改等价条件
sltest.testManager.SignalCriteria. 添加或修改信号标准
sltest.testmanager.CustomCriteria Add or modify custom criteria
sltest.testManager.LoggedSignal. 创建或修改已记录的信号用作仿真输出
sltest.testmanager.loggedSignalSet. 创建或修改一组记录的信号

Iterations

单词 创建测试迭代
sltest.testManager.TestEritation. Create or modify test iteration
sltest.testManager.Parameterset. 添加或修改参数集
sltest.testmanager.ParameterOverride 添加或修改参数覆盖

基于MATLAB的SIMU金宝appLINK测试

sltest.testcase. 测试案例类马铃薯草-基于金宝app与测试管理器集成的测试
loadsystem. 基于MATLAB的SIMULINK测试的负载模型金宝app
模拟 模拟模型或金宝appsimulink.simulationInput.用于基于MATLAB的SIMULI金宝appNK测试
sltest.testcase.。forInteractiveUse 为交互式使用创建测试用例
createTemporaryFolder 创建临时文件夹
假设是AignalSmatch. Assume two data sets are equivalent
assertsignalsmatch. 断言两个数据集是等效的
FatalassertSignalSmatch. 致命断言两个数据集是等效的
VerifySignalSmatch. 验证两组数据是等效的
sltest.harness.simulationInpul. 创建测试线束仿真输入马铃薯草-基于金宝app测试
createSimulationInput 创建仿真输入对象
matlab.unittest.testrunner.addmodelcoverage. 启用收集模型覆盖集合金宝app测试
matlab.unittest.testrunner.add金宝appsimulinktestresults. Enable pushing test results to金宝app测试经理
sltest.plugins.matlabtestCaseIntegrationPlugin. 为基于MATLAB的SIMULINK测试添加模拟和测试结果,以测试管理器金宝app
sltest.plugins.totestManagerlog. Output stream to write text to Test Manager result Logs for MATLAB-based Simulink tests
sltest.plugins.modelcoverageplugin Collect model coverage using the马铃薯草单位测试框架
sltest.testmanager.view. 推出金宝app测试经理
sltest.testManager.SetPref. 设置测试管理器首选项
sltest.testmanager.getPref. 获取测试管理器偏好
sltest.testManager.Options. 返回并指定测试文件选项
sltest.testManager.Close. 关上金宝app测试经理
sltest.testManager.Run. 使用测试管理器运行测试
sltest.testManager.Coverageettings. 修改覆盖设置
sltest.codeImporter. 将C或C ++代码导入金宝app供测试用
sltest.codeimporter.sandboxsettings. Sandbox settings for C code testing
sltest.testmanager.resultset. 访问结果集数据
sltest.testManager.TestFileresult. Access test file results data
sltest.testManager.TestsuiteResult. 访问测试套件结果数据
sltest.testManager.TestCaserSult. 访问测试案例结果数据
sltest.testManager.TestItnerResult.TestationResult. 访问测试迭代结果数据
sltest.testmanager.comparisonRunresult. 比较测试的访问结果
sltest.testmanager.comparisonsignalresult. Access signal comparison results from a baseline or equivalence result
sltest.testmanager.customcriteriaresult. 查看自定义标准测试结果
sltest.testManager.ImportResults. 导入测试管理器结果文件
sltest.testManager.ExportResults. 从测试管理器设置导出结果
sltest.testmanager.getResultsets. 返回测试管理器中的结果集对象
sltest.testManager.ClearResults. 测试经理的结果
sltest.testmanager.report 生成测试结果的报告
sltest.testmanager.testresultreport. 自定义生成的结果报告
sltest.testmanager.TestSpecReport 生成测试规范的报告
sltest.testmanager.diagnosticrecord. 查看自定义标准诊断信息

Steps, Transitions, and Symbols

sltest.testsequence.addstep. 添加测试序列步骤
sltest.testsequence.addstepafter. 在现有步骤后添加测试序列步骤
sltest.testsequence.addstepbefore. 在现有步骤之前添加测试序列步骤
sltest.testsequence.addsymbol. 添加符号以测试序列
sltest.testsequence.addTransition 添加新转换以测试序列步骤
sltest.testsequence.deleteStep. 删除测试序列步骤
sltest.testsequence.deleteSymbol Delete test sequence block symbol
sltest.testsequence.deletextanition. 删除测试序列过渡
sltest.testsequence.editstep. 编辑测试序列步骤
sltest.testsequence.editsymbol. 测试序列块中的编辑符号
sltest.testsequence.editTransition. 编辑测试序列步骤转换
sltest.testsequence.find. 查找测试序列块
sltest.testsequence.findstep. 查找测试序列步骤
sltest.testsequence.find.Symbol Find Test Sequence block symbols
sltest.testsequence.getProperty. 获取测试序列块属性
sltest.testsequence.newblock. 创建测试序列块
sltest.testsequence.readstep. Read Test Sequence block steps
sltest.testsequence.Readsymbol. 读取测试序列块符号属性
sltest.testsequence.readTransition. 读取测试序列过渡的属性
sltest.testsequence.setProperty. 设置测试序列块属性

场景

sltest.testsequence.ActivateCenario. 将测试序列块方案设置为活动
sltest.testsequence.addscenario. Add new scenario to Test Sequence block
sltest.testsequence.CeletEcenario. Delete scenario from Test Sequence block
sltest.testsequence.editscenario. 编辑测试序列块测试场景属性
sltest.testsequence.pletActivescenario. Get Test Sequence block active scenario
sltest.testsequence.getallScenarios. 获取所有测试序列块方案的名称
sltest.testsequence.getscenariocontrolsource. 获取控制测试序列活动方案的源
sltest.testsequence.Isusingscenarios. 确定测试序列块是否使用方案
sltest.testsequence.setscenariocontrolsource. 设置源控制测试序列主动方案
sltest.testsequence.usescenario. 将测试序列块转换为方案模式
sltest.getAssessments 返回测试评估集对象
sltest.assessment. 从集合访问评估
sltest.assessmentset. Access a set of assessments from a simulation
sltest.harness.check. 比较在线束模型和主要模型之间的测试中的组件
sltest.harness.clone. 复制测试线束
sltest.harness.Close. 关闭测试线束
sltest.harness.convert. Convert test harnesses between internal and external storage
sltest.harness.Create. Create test harness
sltest.harness.delete. 删除测试线束
sltest.harness.export 将测试线束导出到Simulink模型金宝app
sltest.harness.find.find. 在模型中找到测试线束
sltest.harness.import. 进口金宝app模型测试线束
sltest.harness.load.load. Load test harness
sltest.harness.move. 将测试线束从链接实例移动到图书馆块或不同的线束所有者
sltest.harness.open. 打开测试线束
sltest.harness.push. 将测试线束工作空间条目和配置设置为型号
sltest.harness.rebuild.rebuild. 重建基于主模型的测试线束和更新工作区条目和配置参数集
sltest.harness.set. 改变测试线束财产

话题

使用脚本创建和运行测试用例

如何使用程序化接口创建和运行测试的示例。

使用基于MATLAB的SIMULINK测试的测试模型金宝app

Write test files in MATLAB that can be used in the Test Manager.

在测试管理器中使用基于MATLAB的S金宝appIMULINK测试

使用基于matlab的仿真软件测试金宝app来模拟模型and verify it against a baseline.

以编程方式创建和运行测试序列方案

以编程方式添加测试场景以测试序列块。

特色例子