Contenuto principale

Workflow Automation Using Python API

Create and manage projects, run test manually or with scripts

You can manage Polyspace® Test™ workflows entirely at the command line by using the Python® API for Polyspace. You can create and manage projects, configure projects based on your toolchain and other requirements, author tests, and build and run tests for C/C++ code. After you run the tests, you can save the results in a Polyspace Test results file or an HTML or XML report.

Before getting started with the Python API, make sure your Python version meets the requirements for use with Polyspace Test. 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.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.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.test Module

expand all

polyspace.test.build(Python) Build project containing C/C++ sources and tests
polyspace.test.BuildResults(Python) Review test results
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.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