Workflow Automation Using Python API
R2026bManage Polyspace® Test™ workflows entirely from Python® — create projects, add sources and tests, build, and run:
import polyspace.project, polyspace.test
proj = polyspace.project.Project("myproject")
proj.Code.Files.add("src/utils.c")
proj.Tests.Files.add("tests/test.c")
res = polyspace.test.run(proj)Before getting started, make sure your Python version meets the requirements. For more information, see Set Up Python API for Polyspace.
polyspace Package
polyspace.__install_path__ | (Python) Get Polyspace installation folder |
polyspace.ErrorWithLog | (Python) Get error logs from actions on a Polyspace project |
polyspace.project Module
polyspace.test Module
Topics
- Set Up Python API for Polyspace
Import
polyspacemodules in Python to create and manage Polyspace projects and results. - Get Started with Python API for Polyspace
Create and configure project, build and run tests, generate reports.
- Calculate Code Coverage of C/C++ Code Using Python API for Polyspace
Run code profiling of C/C++ code using Python API for Polyspace.
- Generate Reports of C/C++ Test Results Using Python API for Polyspace
Save Polyspace Test results as XML or HTML reports.
- Create Project from Build System Using Python API for Polyspace
Dynamically generate source and build information for a project by tracing your build commands.
- Author Graphical Tests Using Python API for Polyspace
Create test suites and test cases, add assessments, build and run tests.
- Test Functions Containing Complex Data Types Using Python API for Polyspace
Create test suites, test cases, and test steps for functions with complex data types.
- Modularize Existing Project by Using Polyspace Python API
Use Python scripts to modularize existing projects by converting configurations and graphical tests to files referenced by the project.
- Create Project Dynamically by Using Polyspace Python API
Use Python scripts to dynamically generate projects from sources, configurations, and tests.
- Supported Operations on Sequences and Sets in Python API for Polyspace
Supported Python operations on sequence and set collection types in the Python API for Polyspace.