Main Content

Test Execution Using Self-Managed Builds

R2026b
Build tests written as C/C++ code using your own toolchain

If you author tests using the Polyspace® Test™ C/C++ xUnit API, you can build and run them using your own toolchain:

gcc example.c test.c <PSTEST_SOURCE> -I <PSTEST_INCLUDE> -o testrunner
./testrunner -format table -test mySuite

The test runner prints structured results directly. Use -format to change the output format and -test to run specific suites or tests. For information on the file paths <PSTEST_SOURCE> and <PSTEST_INCLUDE>, see Set Up C/C++ Testing and Code Profiling Using Self-Managed Builds.

System Commands

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 Functions

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

Topics

Test Execution

Test Results Format