主要内容

使用自管理编译执行测试

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

主题

测试执行

测试结果格式