Main Content

Workflow Automation Using Python API

R2026b
Create and manage projects, run test manually or with scripts

Manage 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

expand all

polyspace.project.Project(Python) Create and manage Polyspace Platform projects
polyspace.project.Workspace(Python) Create and manage Polyspace workspaces
polyspace.project.OwnedBuildConfiguration(Python) Build configurations attached to specific project
polyspace.project.OwnedStaticAnalysisConfiguration(Python) Static analysis configurations attached to specific project
polyspace.project.OwnedTestConfiguration(Python) Testing and profiling configurations attached to specific project
polyspace.project.BuildConfigurationRef(Python) Manage references from project to external build configurations
polyspace.project.StaticAnalysisConfigurationRef(Python) Manage references from project to external static analysis configurations
polyspace.project.TestConfigurationRef(Python) Manage references from project to external testing and profiling configurations
polyspace.project.BuildConfiguration(Python) External build configurations that can be associated with multiple projects
polyspace.project.StaticAnalysisConfiguration(Python) External static analysis configurations that can be associated with multiple projects
polyspace.project.TestConfiguration(Python) External testing and profiling configurations that can be associated with multiple projects
polyspace.project.ExecutionOptions(Python) Options for test execution in a project
polyspace.project.ProjectToolchain(Python) Store toolchain configuration for a build configuration
polyspace.project.Processor(Python) Store processor configuration for a build configuration
polyspace.project.parseCode(Python) Parse C/C++ source code added to project
polyspace.project.CodeInfo(Python) Store information about types, functions, and globals in parsed source code
polyspace.project.Function(Python) Store information about a function in parsed source code
polyspace.project.Global(Python) Store information about a global variable in parsed source code
polyspace.project.Type(Python) Store information about a C/C++ type in parsed source code
polyspace.project.Stubs(Python) Manage external C/C++ stub files
polyspace.project.FunctionStub(Python) Create and update project-specific stub for undefined function
polyspace.project.VariableStub(Python) Create and update project-specific stub for undefined variable
polyspace.project.Mock(Python) Create and update mock for function
polyspace.project.OwnedTestCase(Python) Create and manage owned test cases saved in project
polyspace.project.TestCase(Python) Edit referenced test cases saved in .pstestd file
polyspace.project.TestCaseRef(Python) Manage test cases referenced by project
polyspace.project.ScriptedTestStep(Python) Create and manage scripted test steps
polyspace.project.TabularTestStep(Python) Create and manage tabular test steps
polyspace.project.CallSequenceAssessment(Python) Access and configure function call sequence assessment for test step

polyspace.test Module

expand all

polyspace.test.generateTests(Python) Generate C/C++ unit tests automatically
polyspace.test.BoundaryTestOptions(Python) Configure automatic boundary-value test generation
polyspace.test.CoverageTestOptions(Python) Configure automatic test generation to meet coverage objectives
polyspace.test.FunctionTestGenerationConfiguration(Python) Configure function-based automatic test generation
polyspace.test.ScriptedTestGenerationConfiguration(Python) Configure script-based automatic test generation
polyspace.test.build(Python) Build project containing C/C++ sources and tests
polyspace.test.BuildResults(Python) Review build log
polyspace.target(Python) Manage host compilers or manage hardware targets for running C/C++ tests using Polyspace Test
polyspace.test.run(Python) Run test executable for specified project
polyspace.test.TestResults(Python) Review test results
polyspace.test.TestSuiteResult(Python) Review test results for a specific test suite
polyspace.test.TestCaseResult(Python) Review test results for a specific test case in a suite
polyspace.test.AssessmentResult(Python) Review results for a specific assessment in a test
polyspace.test.ProfilingResults(Python) Review code profiling results
polyspace.test.CoverageResults(Python) Review code coverage results
polyspace.test.StatementCoverageInfo(Python) Review statement coverage results
polyspace.test.DecisionCoverageInfo(Python) Review decision coverage results
polyspace.test.ConditionCoverageInfo(Python) Review condition coverage results
polyspace.test.MCDCCoverageInfo(Python) Review MCDC coverage results
polyspace.test.FunctionCoverageInfo(Python) Review function coverage results
polyspace.test.RelationalBoundaryInfo(Python) Review relational boundary coverage results
polyspace.test.CoverageFilters(Python) Create filters for code coverage results
polyspace.test.ProfilingResults(Python) Review code profiling results
polyspace.test.ExecutionProfilingResults(Python) Review execution profiling results
polyspace.test.ProfilingResults(Python) Review code profiling results
polyspace.test.StackProfilingResults(Python) Review stack profiling results
polyspace.test.ProfilingResults(Python) Review code profiling results
polyspace.test.SanitizerProfilingResults(Python) Review code sanitizer profiling results

Topics