使用自管理编译执行测试
R2026b使用您自己的工具链编译以 C/C++ 代码编写的测试
如果您使用 Polyspace® Test™ C/C++ xUnit API 编写测试,则可以使用自己的工具链编译和运行这些测试:
gcc example.c test.c <PSTEST_SOURCE> -I <PSTEST_INCLUDE> -o testrunner
./testrunner -format table -test mySuite测试运行器直接输出结构化结果。使用 -format 更改输出格式,使用 -test 运行特定的套件或测试。有关文件路径 <PSTEST_SOURCE> 和 <PSTEST_INCLUDE> 的信息,请参阅Set Up C/C++ Testing and Code Profiling Using Self-Managed Builds。
系统命令
polyspace-test -monitor | (System Command) Monitor execution of C/C++ xUnit tests and retrieve test and code profiling results |
polyspace-test -convert | (System Command) Convert test or code profiling results to standard Polyspace Test format |
polyspace-test -generate | (System Command) Generate test registration function from a set of Polyspace Test C/C++ test files |
CMake 函数
pstest_add_convert_target | (CMake) Create target for converting test or code profiling results to standard Polyspace Test format |
pstest_add_report_target | (CMake) Generate XML and HTML reports from test or code profiling results |
主题
测试执行
- Execute C/C++ Tests Written Using Polyspace Test xUnit API
Execute all tests or specific suites, display test results in specific format. - 在 Polyspace 平台用户界面中向工程添加 C/C++ xUnit 测试
使用 Polyspace Test xUnit API 编写测试并从 Polyspace 平台用户界面执行这些测试。 - Use CMake to Execute Tests Authored Using Polyspace Test xUnit API
Use Polyspace Test CMake package to manage test execution workflow.
测试结果格式
- Results Format of Tests Written Using Polyspace Test API
View results of test execution in tabular format, Test Anything Protocol (TAP) format, or another format.
- Compare and Display Values for Complex C/C++ Data Types Using Polyspace Test xUnit API
Write custom comparison and display functions for use in Polyspace Test assessment macros.