在 Polyspace 平台用户界面中执行测试
在 Polyspace 平台工程中设置适当的选项后,您可以在该工程中编译和运行测试。
若在编译过程中遇到错误,可以使用编译日志中的错误消息来解决这些错误。还可以在编译工程之前先运行快速测试验证。
若在测试执行过程中遇到错误,可以对测试运行静态分析,以确保测试数据不会导致运行时错误。
Polyspace 选项
工具
| Polyspace 平台设置 | Settings for Polyspace Platform user interface (自 R2023b 起) |
| 工具链 | Create, validate, and register a custom toolchain for building C/C++ sources and tests |
主题
配置工程
- Configure Project for Testing in Polyspace Platform User Interface
Specify targets and build information to build and run tests. - 在 Polyspace 平台用户界面中指定用于测试的 C/C++ 编译器
指定支持的编译器以进行初始代码分析和测试编译。
验证、编译和运行测试
- Build and Run Tests in Polyspace Platform User Interface
Validate tests, compile sources and tests into executables, run test executables. - Check for Bugs and Run-Time Errors in C/C++ Tests and Functions Under Test
Using Polyspace® Bug Finder™ or Polyspace Code Prover™, check for undefined behavior that might make test results suspect. - Difference Between Code Prover Analysis of Tests and Full Code Prover Analysis
A Code Prover analysis of tests analyzes the function under test only with respect to test inputs.
打开测试结果
- Open Polyspace Results in Polyspace Platform User Interface
See all the ways you can open Polyspace results.
疑难解答
Fix Project Build Errors in Polyspace Platform User Interface
Troubleshoot project build errors because of issues in source files or tests.
Fix Test Execution Failures in Polyspace Platform User Interface
Troubleshoot test execution failures.
Fix Multiple main Error in Polyspace Platform User Interface
Troubleshoot errors related to main function when building Polyspace Platform projects.
Fix Undefined Symbol Errors in Polyspace Platform User Interface
Troubleshoot errors related to undefined symbols when building Polyspace Platform projects.
Fix Build Errors from Non-C/C++ Files in Polyspace Platform User Interface
Troubleshoot errors related to non-C/C++ files when building Polyspace Platform projects.