主要内容

使用 Python API 实现工作流自动化

创建和管理工程、手动或使用脚本运行测试

您可以通过使用 Python® API for Polyspace® 完全在命令行中管理 Polyspace Test™ 工作流。您可以创建和管理工程,根据工具链和其他需求配置工程,编写测试,以及编译和运行 C/C++ 代码测试。运行测试后,您可以将结果保存在 Polyspace Test 结果文件或者 HTML 或 XML 报告中。

在开始使用 Python API 之前,请确保您的 Python 版本满足使用 Polyspace Test 的要求。有关详细信息,请参阅Set Up Python API for Polyspace

polyspace 包

polyspace.__install_path__(Python) Get Polyspace installation folder
polyspace.ErrorWithLog(Python) Get error logs from actions on a Polyspace project

polyspace.project 模块

全部展开

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 模块

全部展开

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

主题