winft / wrapland

Qt/C++ library wrapping libwayland
GNU Lesser General Public License v2.1
6 stars 2 forks source link

Add CI code coverage report #61

Closed romangg closed 8 months ago

romangg commented 4 years ago

What is code coverage

A code coverage report describes how much percentage of a given code base is tested through autotests. Such reports can be generated by GCC and Clang.

For increased stability add a code coverage job to Wrapland CI (and later to the other KWinFT projects).

Setup

GCC directly

Set -fprofile-arcs and -ftest-coverage compilation flags. Report is generated with gcov afterwards and and viewed with lcov. See following tutorial for that.

In CMake

Services

romangg commented 3 years ago

With !89 I decided to go for a more low-tech approach with the GCC compilation flags directly and using GitLab's provided functionality of CI pipelines and GitLab pages instead of any external services as this reduces complexity and should be good enough for our purposes. See the MR for more information.

In the future one could still think about also pushing the coverage information to an external service like Codecov if this promises strong advantages over the report we'll have via GitLab pages.

romangg commented 3 years ago

mentioned in commit 9d17ccb2ddc034cb228c4a729ce70d21dc3e47bd