Questions tagged [lcov]

LCOV is a graphical front-end for GCC's coverage testing tool gcov

LCOV is a graphical front-end for GCC's coverage testing tool gcov. It collects gcov data for multiple source files and creates HTML pages containing the source code annotated with coverage information. It also adds overview pages for easy navigation within the file structure. LCOV supports statement, function and branch coverage measurement.

The homepage of the project is here.

286 questions
8
votes
3 answers

How to view code coverage as html for Flutter in Windows?

I did flutter test --coverage A lcov.info was generated under coverage I want to convert this into html but I don't find a tool for Windows. On linux, you just do: sudo apt-get update -qq -y sudo apt-get install lcov -y Then you do genhtml…
TSR
  • 17,242
  • 27
  • 93
  • 197
8
votes
3 answers

C++ Using gcov and lcov problem?

I am using ubuntu 10.1, g++ compiler. I trying to use gcov and lcov for my C++ project. I manage to compile the gcov: g++ -fprofile-arcs -ftest-coverage main.cpp user.cpp game.cpp There is no error or warning message. Next I try to run gcov: gcov…
cpp_noob
  • 253
  • 2
  • 6
  • 12
8
votes
1 answer

Can lcov/genhtml show files that were never executed?

How can I make lcov and genhtml show files that are not linked / loaded? I'm using it to show test coverage and I would like to see every source file appear in the HTML report, even if it has zero coverage. That way I can use lcov to identify source…
Evan
  • 538
  • 6
  • 11
8
votes
1 answer

lcov absolute versus relative paths

How does lcov decide when to use absolute paths versus relative paths? I have an app directory containing subdirectories for each of my product's shared libraries and subdirectories for several binaries. Something like…
Josh Kelley
  • 56,064
  • 19
  • 146
  • 246
7
votes
1 answer

constexpr constructor won't show coverage data

Today I was rewriting my matrix class to be constexpr. I have(had) 100% unit test coverage on this class but I noticed after I converted almost all functions to constexpr a part of the constructor is marked in the lcov as no longer covered at…
user2882307
7
votes
2 answers

Function coverage is lesser even with 100% code coverage when objects created in the stack

I'm analyzing my code with gcov. It says my code is 2 functions lesser when objects are created in the stack. But when I do new-delete 100% function coverage is achieved. Code: class Animal { public: Animal() { } virtual ~Animal() …
Sujith Gunawardhane
  • 1,251
  • 1
  • 10
  • 24
6
votes
1 answer

Code Coverage (Lcov) incorrectly showing 100% coverage

I have the following setup (using g++ 10 and lcov 1.14): g++ SampleScript.cpp -g -O0 -fprofile-arcs -ftest-coverage -o MyScript ./MyScript lcov -d . -c -o coverage.info --rc lcov_branch_coverage=1 genhtml coverage.info -o cov_out --legend…
Phil-ZXX
  • 2,359
  • 2
  • 28
  • 40
6
votes
2 answers

Adding lcov to Hudson

rather new to Hudson here. I was wondering, how would one integrate lcov with it? How would I install the tarball into a Hudson job?
Apophenia Overload
  • 2,485
  • 3
  • 28
  • 46
6
votes
3 answers

Using lcov with gcc-8

I am trying to determine my testcoverage. To do this I compile my program with a newer version of gcc: CC=/usr/local/gcc8/bin/gcc FC=/usr/local/gcc8/bin/gfortran ./configure.sh -external cmake -d After compiling this with the --coverage option I…
Stein
  • 3,179
  • 5
  • 27
  • 51
6
votes
1 answer

lcov marking lines with function declarations as reachable but not covered

I'm trying to use lcov (v1.13, on OS X, with clang as compiler) to generate code coverage for my test suite and I've hit one annoying problem that I don't know how to solve. There's a few similar questions on SO, but I couldn't find the solution to…
aldanor
  • 3,371
  • 2
  • 26
  • 26
6
votes
1 answer

How do I generate coverage reports for fork()'d children using gcov/lcov?

I'm having trouble generating coverage reports for a project of mine -- it seems that the lines in the child process after a fork are never hit, althought they clearly are in reality. Here is the coveralls report of the forking part (The results are…
Snaipe
  • 1,191
  • 13
  • 25
6
votes
1 answer

How to merge multiple versions of gcda files?

I'm using gcov for get coverage information of my application. However, there are 3 instances of my applications are running concurrently creating 3 versions of "gcda" files. Is there a way to merge different versions of same "gcda" files in my…
Sujith Gunawardhane
  • 1,251
  • 1
  • 10
  • 24
6
votes
5 answers

How to exclude lcov branches within a macro

I've got some logging macros in my code along the lines of: #define LOG_MSG (pri, msg, ... ) \ if (pri > PriorityLevel ) \ printf( msg, ##\__VA_ARGS__); I know I can use LCOV_EXCL_START, LCOV_EXCL_STOP or LCOV_EXCL_LINE to suppress a…
perogiex
  • 505
  • 5
  • 10
6
votes
1 answer

How to include test case descriptions in lcov/genhtml code coverage output

I'm using lcov to generate code coverage reports for a C code base. I would like to integrate test descriptions into the final output (using lcov's gendesc utility.) However, I have no clue on how to do that, and documentation on gendesc seems…
luis.espinal
  • 10,331
  • 6
  • 39
  • 55
6
votes
2 answers

Getting lcov to work on Cygwin

What Cygwin package(s) do I need to install to get lcov to work on Cygwin? I tried to run lcov and received the following: command not found Thank you for any help. P.S. I should point out that gcov does work.
JustADude
  • 2,619
  • 7
  • 31
  • 45
1 2
3
19 20