I am relying on meson and ninja to analyze a fairly large FORTRAN codebase. I am stuck at the step where I use ninja coverage-html
to get a line coverage analysis. I am using these commands:
meson setup build --reconfigure -Db_coverage=true
meson compile -C build
meson test -C build --suite qcxms --verbose -t 0
ninja coverage-html -C build # This will inevitably exclude files I need!
Whatever I do, when running ninja coverage-html -C build
I always see a wall of Excluding xyz.f90
messages, and I don't see those excluded files in the final analysis.
I have tried adding an .lcovrc
file in the project root to explicitly include all f90 files like so:
include = **/*.f90
Still, this doesn't work. How do I proceed?
I am relying on meson and ninja to analyze a fairly large FORTRAN codebase. I am stuck at the step where I use ninja coverage-html
to get a line coverage analysis. I am using these commands:
meson setup build --reconfigure -Db_coverage=true
meson compile -C build
meson test -C build --suite qcxms --verbose -t 0
ninja coverage-html -C build # This will inevitably exclude files I need!
Whatever I do, when running ninja coverage-html -C build
I always see a wall of Excluding xyz.f90
messages, and I don't see those excluded files in the final analysis.
I have tried adding an .lcovrc
file in the project root to explicitly include all f90 files like so:
include = **/*.f90
Still, this doesn't work. How do I proceed?
Share Improve this question asked Mar 12 at 10:31 tornikeotornikeo 9678 silver badges21 bronze badges1 Answer
Reset to default 0I have found a workaround purely by using the lcov
and genhtml
commands themselves. Specifically:
- Navigate to the build directory
- Run
lcov
like so (notice the../**/*.f90
, this is the coverage inclusion list):
lcov --extract meson-logs/coverage.info.raw \
../**/*.f90 \
--rc branch_coverage=1 \
--output-file meson-logs/coverage.info \
--config-file ../.lcovrc \
--ignore-errors unused
- Finally, run
genhtml
:
genhtml --output-directory coveragereport meson-logs/coverage.info
This will bypass whatever problem the ninja coverage-html
has and will generate a report website under coveragereport/index.html
.