Integrating C/C++test with GitLab allows you to run code analysis, collect code coverage data and test results with Parasoft C/C++test and review results directly in GitLab.
To integrate with GitLab, modify your GitLab workflow to include a job that will:
For static analysis,
Run C/C++test.
- Upload the results in the GitLab-specific SAST format.
- Upload the reports in other formats (XML, HTML, etc.).
To ensure that the result are displayed, you must properly configure analysis with C/C++test. In particular, you must be sure to configure the SAST report format. When the pipeline completes, you can review the results in the Security tab of the GitLab pipeline and on GitLab's Vulnerability Report.
For unit tests,
- Run C/C++test.
- Use Saxon to convert C/C++test unit tests report to xUnit format.
- Upload the transformed xUnit report.
When the pipeline completes, you can review the test results handled by C/C++test in the Tests tab of the GitLab pipeline.
For coverage,
- Run C/C++test.
- Use Saxon to convert C/C++test coverage report to Cobertura format.
- Upload the transformed Cobertura coverage report.
After the pipeline triggered by a merge request completes, you can review the code coverage data collected by C/C++test in the file diff view of the GitLab Merge requests.
You can find more details and example workflow configuration at https://gitlab.com/parasoft/cpptest-gitlab.