使用 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.test 模块
主题
- Set Up Python API for Polyspace
Import
polyspacemodules in Python to create and manage Polyspace projects and results. - Python API for Polyspace 快速入门
创建和配置工程、编译和运行测试、生成报告。
- 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.
- 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.