Test Execution Using Self-Managed Builds
R2026bBuild 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 mySuiteThe 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
- Execute C/C++ Tests Written Using Polyspace Test xUnit API
Execute all tests or specific suites, display test results in specific format. - Add C/C++ xUnit Tests to Projects in Polyspace Platform User Interface
Write tests using Polyspace Test xUnit API and execute them from Polyspace Platform user interface. - Use CMake to Execute Tests Authored Using Polyspace Test xUnit API
Use Polyspace Test CMake package to manage test execution workflow.
Test Results Format
- 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.