C++ 为什么codecov和lcov不能在Travis上正常工作,而是在我的本地Linux Mint上正常工作?

C++ 为什么codecov和lcov不能在Travis上正常工作,而是在我的本地Linux Mint上正常工作?,c++,gcov,lcov,codecov,C++,Gcov,Lcov,Codecov,我试图为我的客户添加CI构建系统。 下面的示例如下所示: 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 in

我试图为我的客户添加CI构建系统。 下面的示例如下所示:

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"
显然这里有个问题,但我不明白是什么问题。我无法在本地机器上复制它,也无法在线搜索,也无法找到解决方案。

travis和我的本地机器都使用GCOV8.1.0。在travis上,我使用lcov 1.13,在我的本地机器上使用lcov 1.12。我用以下方法编译:

我将非常感谢任何解决方案或想法

编辑:
解决了这个问题。gcc 8似乎引起了一些问题。使用gcc 7很好。

我遇到了一个类似的问题,我通过将LCOV更新到1.13-4版本(在ubuntu 18.04 LTS上,apt提供的版本是1.13-3)来解决它。

你最终找到解决方案了吗?我这里也有同样的问题,我认为这是最新的gcc/gcov的问题,您在您的机器和travis上使用的是哪个版本?“travis和我的本地机器都使用gcov 8.1.0。在travis上,我使用lcov 1.13和我的本地机器版本1.12。”以及“编辑:修复了问题。gcc 8似乎引起了一些问题。正如我在回答中所说,在1.13-4中有一个bug修复,所以你可以用gcc8再试一次,最新的LCOVI可以确认这解决了Ubuntu 18.04 LTS上的问题。我从18.10下载了.deb包。它安装得很好。
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
-Wall (... various warning flags) -m32 -g -O0 -fprofile-arcs -ftest-coverage --coverage