5

I tried to add Codecov to my CI build system for my library. The travis script looks like this:

lcov --directory . --capture --output-file coverage.info --gcov-tool gcov-8 # capture coverage info
lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system
lcov --list coverage.info # debug info
# Uploading report to CodeCov
bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports"

When I run these commands on my local Linux Mint machine everything works as expected. But on Travis it doesn't. Report looks like this:

Capturing coverage data from .
Found gcov version: 8.1.0
Scanning . for .gcda files ...
geninfo: WARNING: /home/travis/build/AMS21/Andres-Standard-Library/CMakeFiles/unittest.dir/test/src/cstddef/offsetof_test.cpp.gcno: Overlong record at end of file!
Found 132 data files in .
Processing unittest.dir/test/src/cstddef/offsetof_test.cpp.gcda
geninfo: WARNING: cannot find an entry for #home#travis#build#AMS21#Andres-Standard-Library#test#include#doctest.h.gcov in .gcno file, skipping file!
geninfo: WARNING: cannot find an entry for #home#travis#build#AMS21#Andres-Standard-Library#test#src#cstddef#offsetof_test.cpp.gcov in .gcno file, skipping file!
(...)
Finished .info-file creation
lcov: ERROR: no valid records found in tracefile coverage.info
Reading tracefile coverage.info
Reading tracefile coverage.info
lcov: ERROR: no valid records found in tracefile coverage.info

So obviously there is a Problem here, but I do not understand what it is. And I cant replicate it on my local machine and searching online I also couldn't find a solution.
Both travis and my local machine use gcov 8.1.0. And on travis I use lcov 1.13 and on my local machine version 1.12. I compile with the following flags:

-Wall (... various warning flags) -m32 -g -O0 -fprofile-arcs -ftest-coverage --coverage

I would be very thankful for any solutions or ideas.

Edit: Fixed the problem. It seems that gcc 8 is causing some problems. Using gcc 7 works just fine.

AMS
  • 51
  • 1
  • 5
  • Did you finally found a solution? I have the same problem here, I think it's an issue with the latest gcc/gcov, whiche version are you using on your machine and on travis? – Jeremad Nov 08 '18 at 13:46
  • "Both travis and my local machine use gcov 8.1.0. And on travis I use lcov 1.13 and on my local machine version 1.12." and "Edit: Fixed the problem. It seems that gcc 8 is causing some problems. Using gcc 7 works just fine." – AMS Nov 10 '18 at 21:24
  • As I said in my answer, there was a bug fix in 1.13-4, so you can try again with gcc8 and the latest LCOV – Jeremad Nov 22 '18 at 09:39

1 Answers1

5

I encountered a similar issue, I solved it by updating LCOV to the 1.13-4 version (on ubuntu 18.04 LTS, the version available with apt is 1.13-3)

Jeremad
  • 883
  • 2
  • 10
  • 21
  • I can confirm that this solves the problem on Ubuntu 18.04 LTS. I downloaded the .deb package from 18.10. It install just fine. – MuhKuh Feb 21 '19 at 23:02