brenoguim / flexclass

A library for classes with flexible layout
MIT License
56 stars 6 forks source link

Add code coverage #18

Open brenoguim opened 3 years ago

brenoguim commented 3 years ago

A lot of the code is templated but it would be nice to have code coverage infrastructure.

eullerborges commented 3 years ago

I actually managed to get code coverage working with codecov (which is free for open source projects), but mapping coverage to the actual repository files failed miserably.

This happens because the cmake infrastructure merges the headers into flexclass/include/flexclass.hpp under the build directory (and for installation, of course) and the test binaries are built considering that file. Given the file doesn't exist on the repository, mapping to source doesn't work properly.

Using lcov to parse the coverage results on the other hand does work, but I still didn't find a way to integrate it to get a coverage report like we get for the performance regression, unfortunately. I hit a dead-end, it seems.

eullerborges commented 3 years ago

I've also just tried to use Coveralls, which directly supports lcov and it didn't work either for the same reason: it tries to look for the file in the repository. Coverage statistics are displayed, we do get a badge, but no coverage info: image

One option is to just use one of those two systems so that we can have a badge on the main page and numbers on the statistics, and provide a new command in cmake to generate the HTML lcov result which looks pretty decent on a browser: image