Submit Polyspace Files to Version Control
To share a Polyspace® Platform project and keep it in sync with its resources, you can submit source code files and certain Polyspace files to your version control system. This topic describes the files you need to submit, the generated files to exclude from your version control system, and how to work with Polyspace files in version control.
Code Files to Submit
Submit these code files to your version control system:
All application source files
All application header files
Any test files authored using the Polyspace Test™ xUnit API
Any test files authored using an external xUnit test authoring framework such as GoogleTest
Polyspace Files to Submit
Depending on how you structure your project, there are several Polyspace files to submit to version control. These can include:
Polyspace Platform project file (
.psprjx) — Usually, you submit the project file to version control. However, if you use the Polyspace Test Python® API to recreate projects from the latest versions of the source, configuration, and test files, you do not need to submit the project file. For an example of creating a project from its source and component files, see Create Project Dynamically by Using Polyspace Python API (Polyspace Test).Polyspace workspace file (
.pswks) — Submit workspace files if you are using workspaces to manage multiple projects. Because workspace files point to projects using relative paths, submitting both workspaces and projects ensures that they stay in sync. For more information on workspaces, see Manage Related Projects in Polyspace Platform User Interface Using Workspaces.External configuration files (
.pscfg) — Submit any external build, static analysis, or testing and profiling configurations that the project references. For more information, see Share and Reuse Configuration Variants.Graphical test files (
.pstestd) — Submit any graphical test case files that the project references. For more information, see Modularize Project by Converting Graphical Tests to Test References in Polyspace Platform User Interface (Polyspace Test).
Generated Files to Exclude
When you build or run static analysis or tests on a project, Polyspace generates files in an artifacts folder and a results folder. Do not submit these folders of generated files to version control. For more information on these generated files, see Artifacts and Results Generated by Polyspace Platform Projects.
Working with Polyspace Files in Version Control
You can interact with Polyspace files in a version control system like any other file. In a typical Polyspace workflow that uses version control, you may perform these actions:
Check out the project file and any referenced files that need updating (sources, xUnit tests,
.pscfgconfiguration files,.pstestdgraphical test files)Open the project in the Polyspace Platform user interface.
Make necessary changes, for instance:
Add source files.
Modify or add new tests. To modify an existing graphical test case that is referenced by the project, check out the referenced
.pstestdfile first. If you add a new graphical test, convert it to a test reference and submit the referenced.pstestdfile along with the updated project file.Change configuration options. To modify an external configuration, check out the referenced
.pscfgconfiguration file first. If you add a new configuration variant, convert it to an external configuration and submit the referenced.pscfgfile along with the updated project file.
Verify the changes, for instance:
Make sure that the project continues to build successfully.
Run tests to make sure they pass.
Run static analysis and confirm that you did not introduce any new issues.
Compare your version of the project and any supporting files you updated with the versions in source control and resolve any merge conflicts.
Submit the updated
.psprjxproject file and any supporting files you changed or added.