boostorg / histogram

Fast multi-dimensional generalized histogram with convenient interface for C++14
Boost Software License 1.0
315 stars 71 forks source link

Update lcov coverage #324

Closed sdarwin closed 3 years ago

sdarwin commented 3 years ago

Hi,

Some info about the changes:

I also want to generate coverage data offline.

That should be fairly simple, by running the same CI scripts on a local machine. I will test it out, and send over the steps.

sdarwin commented 3 years ago

The most recent commit includes "tools/cov_offline.sh". Running this standalone script will -

HDembinski commented 3 years ago

Cool, thanks, sorry for the late reply.

gcov ideally shouldn't be hardcoded to version 8. Rather, match the gcc version. Thus, GCOVTOOL='gcov-4.6' for gcc-4.6, or GCOVTOOL='gcov-6' for gcc-6.

Sure, the problem is that no other version of gcc worked.

HDembinski commented 3 years ago

After careful reading I am going to reject this. This is a very invasive patch that changes at lot of things that do not need changing.

The salient change seems to be to upgrade to lcov-1.15.

sdarwin commented 3 years ago

Hi Hans,

That's fine. The intention was not to rewrite so many aspects of the file, but rather to find a way to quickly implement a "matrix" style build, because you were concerned about multiple different newer gcc versions. I copied an existing ci.yml file, standard boilerplate, and known to be stable. It has a matrix. Then, modified it for lcov.

You are right that the main fix is lcov-1.15.

Keep in mind that point about the GCOV version matching. It was done here with a variable in the matrix, instead of hardcoded.

You had asked about offline testing, outside of CI. The file tools/cov_offline.sh in this pull request does that. So, you could merge that script separately. The only concern .... is line 45 of tools/cov.sh

$LCOV --base-directory `pwd`/../../ \

Notice this sets the base directory to be boost-root.

Which reminds me... testing all versions lcov with gcc, including gcc-9 and gcc-10, I believe there was an issue with the base-directory, and it had to be changed, as shown. By staying with your old coverage files, that may possibly remain an open issue still to be resolved.

The new cov.yml was based on https://github.com/boostorg/core/blob/develop/.github/workflows/ci.yml , and pdimov is doing a great job of keeping that GHA configuration in shape. Standardizing on his work for github actions isn't a bad idea.