生成代码测试
对集成代码、C 代码和以前版本的代码运行测试
您可以创建并运行测试来验证生成代码、人工代码以及以前版本的生成代码。还可以使用 MATLAB 单元测试框架来测试模型和代码。
函数
sltest.CodeImporter | Import C or C++ code into Simulink for testing (自 R2021a 起) |
sltest.CodeImporter.SandboxSettings | Sandbox settings for C code testing (自 R2021a 起) |
createSandbox | Create sandbox for C code unit testing (自 R2021a 起) |
主题
- Importing and Testing Custom C/C++ Code
You can test custom C or C++ code by importing it into Simulink® using the Code Importer wizard in the Test Manager or API commands at the MATLAB® command line.
- Test Integrated Code
Test code integrated in a Simulink model using C Caller blocks or S-Functions.
- Test Models Using MATLAB Unit Test
Test integration with MATLAB test scripts.
- Use SIL/PIL to Verify Generated Code from an Earlier Release
Use generated code that was verified using SIL or PIL in a previous release to verify code in current release.
- Code Generation Verification Workflow with Simulink Test
Perform code generation verification for a model.
- Test Execution Order
Order in which models load, and test cases, iterations, and callbacks run.