A minimal, reproducible example for testing code coverage of C code using GCC or Clang.
Use nix for an automatic setup.
nix develop
Otherwise, install gcc
, just
and lcov
.
Run the report
target to generate an HTML coverage report.
just report
Take a look at the justfile to see the individual steps.
Use nix for an automatic setup.
nix develop .#clang
Otherwise, install clang
, just
, lcov
and llvm
.
Run the report1
target to generate an HTML coverage report.
just report1
Take a look at the justfile to see the individual steps.