Questions tagged [gcovr]

114 questions
30
votes
5 answers

Is there anyway to merge cobertura coverage xml reports together?

I have c++/c application with a lots of unit tests. I would like to get overall coverage and also individual coverage of each test with condition that each test can be run only once. Format of coverage must be xml (cobertura xml) for jenkins…
jan-hybs
  • 624
  • 2
  • 8
  • 18
26
votes
1 answer

Is it possible to merge coverage data from two executables with gcov/gcovr?

On one project, I'm running the test cases on three different executables, compiled with different options. Depending on the options, some code paths are taken or not. Right now, I'm only using the coverage data from one executable. I'm using gcovr…
Baptiste Wicht
  • 7,472
  • 7
  • 45
  • 110
9
votes
2 answers

Xcode 7 generating GCOV

so the hot new feature in Xcode 7 is code coverage integrated within XCode - yaaay! With this new feature also comes Apple's new code coverage format .profdata. We need to display code coverage reports in Cobertura reports (loaded in Jenkins).…
7
votes
1 answer

gcov ignoring lines in source file

I'm using gcov to metric testing coverage on a c++ library I contribute to. For some reason, gcov isn't recognizing lines in many of the files as executable. Out of 160-some lines in a given file it'll say that 40 of them are executable. For…
Jake Fenton
  • 101
  • 3
6
votes
2 answers

How to use gcovr with source files outside the current/build/run directory?

mkdir -p /tmp/build && cd /tmp/build && mkdir -p /tmp/src && echo "int main(){return 0;}" > /tmp/src/prog.c && gcc --coverage -o prog /tmp/src/prog.c && ./prog && gcovr -v -r . will output an empty report. Scanning directory . for gcda/gcno…
not-a-user
  • 4,088
  • 3
  • 21
  • 37
5
votes
1 answer

Trouble with gcovr exclusions

I am running gcovr (3.3) on an out of source build like: gcovr --root=/path/to/source --object-directory=/path/to/build Now I want to exclude two different things from the report: 1) Any .cpp files that have "Test" in their name --exclude='.*Test.*'…
David Doria
  • 9,873
  • 17
  • 85
  • 147
5
votes
2 answers

Output color code of Gcov with Cobertura

I have set gcov code coverage tools on Jenkins. This works fine, but I have troubles undertanding the ouput color code. The number of 'hits' of each line is corect, but some line are green when others are red, and I can't tell why. Example : Note…
MokaT
  • 1,416
  • 16
  • 37
5
votes
1 answer

Exclusion markers for gcov

I'm using gcov to measure coverage in my C++ code. I'd like to be able to mark certain lines of source code so that they are excluded from coverage reporting when using gcovr. I know they exist because I stumbled across them once but now I can't…
ksl
  • 4,519
  • 11
  • 65
  • 106
5
votes
3 answers

GCovr does not generate a valid report

I want to set up my Jenkins with Cobertura to track code coverage. Unfortunately I can not generate a valid xml. I'm using: gcovr 2.5-prerelease (r2774) Xcode 4.6.1 Build version 4H512 My project is generating code coverage files correctly, but…
Giuseppe
  • 6,666
  • 2
  • 20
  • 32
4
votes
3 answers

Is it possible to exclude a redundant, invisible else branch with gcov?

Imagine the following function: int myFunction(my_enum_t x) { int result = 0; if ((x != ENUM_VAL_A) && (x != ENUM_VAL_B) && (x != ENUM_VAL_C)) { result = -1; } if (0 == result) { result = mutateSomething(x); } …
Walkingbeard
  • 590
  • 5
  • 15
4
votes
2 answers

How to merge coverage reports?

I have a C program which I compile with -fprofile-arcs -ftest-coverage flags.Then I run the program on 5 different inputs, this will override the .gcda file and give me a combined report.But I want to have the coverage report of individual tests and…
VVish
  • 251
  • 4
  • 11
4
votes
1 answer

Error when i try to produce html report with gcovr, 'NoneType' object has no attribute 'startswith'

I get the error 'NoneType' object has no attribute 'startswith' when trying to produce the html report with gcovr (tool for estimating the coverage of tests) Any idea how should I fix it? For info, I am on Ubuntu 14.04. See the detail error…
zell
  • 9,830
  • 10
  • 62
  • 115
4
votes
2 answers

How to ignore header files in gcov output?

I am using gcov and gcovr to generate my code test coverage (the tests are done with google test++). So, I compile with the -ftest-coverage -fprofile-arcs options, and then I run gcovr (which itself runs gcov). However, on my output, I have the cpp…
pip
  • 185
  • 2
  • 2
  • 12
4
votes
0 answers

CMake + Jenkins for code coverage of untested file

I am looking for a solution to have a code coverage statistics among all C source file compiled in one cmake project and published under Jenkins. I use CMake 2.8.9, gcovr 3.1, Jenkins 1.564 and tried many different version of gcc/gcov (4.7.2 and >=…
4
votes
5 answers

Gcovr generates coverage data for 0 files

I am setting up code coverage for an iOS application. I am using XCode 5.0.2 and gcovr 3.1 to test and perform code coverage for iOS 7 devices. I initially had issues with .gcda file generation but I followed this blog and resolved the issue. I have…
Jai
  • 51
  • 1
  • 5
1
2 3 4 5 6 7 8