最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

gcov - Prevent ninja coverage-html from Excluding some files - Stack Overflow

programmeradmin0浏览0评论

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 badges
Add a comment  | 

1 Answer 1

Reset to default 0

I have found a workaround purely by using the lcov and genhtml commands themselves. Specifically:

  1. Navigate to the build directory
  2. 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
  1. 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.

发布评论

评论列表(0)

  1. 暂无评论