Skip to content

Generate a coverage-report in html form#68

Open
FuelledByCoffee wants to merge 1 commit intolknknm:mainfrom
FuelledByCoffee:coverage-report
Open

Generate a coverage-report in html form#68
FuelledByCoffee wants to merge 1 commit intolknknm:mainfrom
FuelledByCoffee:coverage-report

Conversation

@FuelledByCoffee
Copy link
Contributor

After building and testing, you can now run cmake --build {build_directory} -t coverage_report

The new coverage_report target depends on llvm-cov (installed by default
on mac along with cli tools), and gcovr.

Prerequisites mac:
	`brew install gcovr`

Prerequisites Linux Ubuntu:
	sudo apt install gcovr llvm
@lknknm
Copy link
Owner

lknknm commented Dec 26, 2025

Hey Fuelled! Thanks for the PR!
I've been having an issue while running as:

cmake -B build -T coverage-report
...
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

Does it happens the same with you?

Moreover can we take the opportunity of this PR and configure cmake to always generate Compile Commands? I'm not sure if it's possible or a good practice though so it's up to you :)

Edit: I just added a set to generate compile commands ON and forcing the default compiler to be Clang.
You can see the changes here: 16fb9c6
Lemme know if you agree :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants