Questions tagged [gcov]

gcov is a code coverage tool for GCC

gcov allows you to analyze which parts of a program are not executed. This is interesting for example in order to know which part of a program are not tested. gcov also serves for profiling purposes.

gcov requires additional flags to be passed to GCC in order to generate a special version of a program. This version shouldn't be shipped because it is slower as it generates coverage data files.

575 questions
3
votes
1 answer

configure: error: missing __attribute__ ((constructor)) support?

I am trying to build glibc library using bitbake environment inside Yocto Project. I am able to build it successfully but when i alter the C compiler flag in local.conf file it is giving missing attribute error. build/conf/local.conf file. here i…
Ajay.kundu
  • 195
  • 2
  • 10
3
votes
0 answers

Gtest with lcov in c++

I have successfully generated the .gcda and .gcno files and they are in the same folder. The flags in the make file looks as below : CPPFLAGS += -std=c++11 --coverage -isystem $(GTEST_DIR)/include CXXFLAGS += -std=c++11 --coverage -g -Wall -Wextra…
Enjal Parajuli
  • 193
  • 1
  • 11
3
votes
1 answer

gcovr does't generate reports for some branches on Jenkins

We found that for some of our Github branches that are automatically pulled into Jenkins, gcovr does not generate any coverage information. It claims that no files are found and returns a code coverage of 0%. Other branches work fine. Once we pull…
mrks
  • 8,033
  • 1
  • 33
  • 62
3
votes
1 answer

Loading a shared library failed with undefined symbol: __gcov_merge_add error

I am trying to integrate gcov for an existing build environment. Adding -fprofile-arcs and -ftest-coverage to CXXFlags got me through building and generating .gcno static files with out any issues. But once I start to deploy this package I am…
3
votes
1 answer

Remove auto generated exception code from coverage report

Let's start with a minimal working example: main.cpp: #include #include int main() { std::cout << "hello " + std::to_string(42); return 0; } I compile this code using the following flags: [g++/clang++] -std=c++11 -g -Og…
datosh
  • 498
  • 7
  • 20
3
votes
1 answer

kcov vs lcov vs raw performance?

Anyone able to give me some info on the relative performance of code running under following conditions, Just compiled Compiled with --coverage Running under kcov Am I going to need twice a long to run my test suite if I integrated code coverage…
Paul D Smith
  • 639
  • 5
  • 16
3
votes
0 answers

CTest doesn't find gcov library

I am trying to use CDash to send test results to a dashboard. It currently can't find gcov. garrett% ctest -D Experimental Site: Build name: (empty) Create new tag: 21170910-5324 - Experimental Configure project Cannot find ConfigureCommand…
Garrett O'Grady
  • 536
  • 5
  • 9
3
votes
1 answer

Gcov report import in Sonarqube-5.6.6(LTS) using CXX Community Plug-in

Our Sonar Build Environment details as follows: SonarQube Server Version - 5.6.6 (64-Bit). Sonar Client Build Operating System – Ubuntu 14.04.5 LTS (64-Bit). Sonar-scanner- Version - 3.0.3.778. sonar-cxx-plugin-0.9.7.jar Source Code Language:…
user4948798
  • 1,924
  • 4
  • 43
  • 89
3
votes
2 answers

Missing certain GCDA files after test execution

I'm currently facing an issue with generating .gcda files for coverage data of a static library. I can get coverage data for most files, but not all. I'll refer to the object file with the missing coverage data as X. Some things to note: I have…
3
votes
0 answers

gcov reports no coverage for class declaration

I have a C++ class, Foo. When I run gcov on my unit tests, it reports good coverage data for Foo's methods, but on the class declaration itself is reports nothing: 14 0 : class DllExport Foo: public Bar { 15 : protected: …
Nathan
  • 1,218
  • 3
  • 19
  • 35
3
votes
1 answer

gcov reporting wrong result for header only class

There were already many similar questions asked before: Getting useful GCov results for header-only libraries Why does gcov report 0% coverage on a header file for a well used class? gcov is not generating coverage information for header files to…
sigy
  • 2,408
  • 1
  • 24
  • 55
3
votes
0 answers

Can I accumulate gcov line counts? (I don't have LCOV)

The gcov data files (*.gcda) accumulate the counts across multiple tests. That is a wonderful thing. The problem is, I can't figure out how to get the .gcov files to accumulate in the same way the .gcda files do. I have a large project (53 header,…
Luv2code
  • 1,079
  • 8
  • 14
3
votes
2 answers

Getting lines of C code in files

We are using gcov and gcovr.py to get coverage reports for our tests. Not all the source files are tested at all and therefore those aren't mentioned in gcovr report. Now I'd like to calculate overall coverage for whole code base nevertheless. From…
burm
  • 93
  • 11
3
votes
2 answers

Why do I get "has arcs from exit block" messages when running gcov?

I am running gcov to measure coverage but I get "has arcs from exit block" message for each of the functions I use in the c code. Is there any problem with this message? Should I ignore them?
mareiou
  • 404
  • 2
  • 11
3
votes
2 answers

gcov function is not executed but lines are

I have been using gcov to check code coverage. I now get a weird result, some functions are listed as not executed but the lines in the function is listed as executed. lcov output: 13 0 : f& operator*=(f& lhs, const…
Jonas
  • 6,915
  • 8
  • 35
  • 53