Open sdarwin opened 1 year ago
@gregnewman, the current script is running these commands:
gcovr --html-details
and
gcovr --json-summary
If the html reports are only minimally customized I had been imagining gcovr --html-details
would continue to be used, modifying the output in various ways.
However, for the most flexibility in the design it is possible to replace that step. Instead of --html-details
run --json-summary
. That produces plain json data. Create html pages from scratch based on the data.
Here's an example of a webpage that generates javascript charts based on benchmark statistics which have been include in a textarea field https://github.com/boostorg/json/blob/develop/bench/results.html
Coverage reports are being generated on pull requests at https://github.com/boostorg/url . For example, in https://github.com/boostorg/url/pull/649 it shows:
GCOVR code coverage report https://649.url.prtest.cppalliance.org/gcovr/index.html LCOV code coverage report https://649.url.prtest.cppalliance.org/genhtml/index.html Coverage Diff https://649.url.prtest.cppalliance.org/gcovr/coverage_diff.txt
The GCOVR report is created by running this command:
However that requires the C++ source code to be available and to have been built so it's useful to have a more complete script. This example script https://github.com/CPPAlliance/ci-automation/blob/master/scripts/jenkins.sh will build everything from scratch.
Run
jenkins.sh
in an ubuntu 22.04 container. gcovr html output will be generated in:./url_job_folder/gcovr/
and json files, discussed in the other github issue, will be here:
./url_job_folder/json/ ./url/json/
Goals:
The aim of the project is to make the html more closely resemble the earlier codecov design before their recent updates.
Codecov results: https://app.codecov.io/github/CPPAlliance/http_proto/tree/develop/include/boost/http_proto . Vinnie will comment further about what's correct or incorrect in those webpages.
Methods:
gcovr html is already customizable to a certain extent. For example, css may be replaced:
--html-css <css>
. See https://gcovr.com/en/stable/manpage.htmlAdd preprocessing or postprocessing steps in a new custom script.
If the gcovr executable itself has to be modified to enable customization to take place, consider submitting pull requests directly to https://github.com/gcovr/gcovr
cc @vinniefalco @gregnewman