首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么带有lcov的codecov在Travis上不能正常工作,而在我本地的Linux Mint上却不能正常工作?

为什么带有lcov的codecov在Travis上不能正常工作,而在我本地的Linux Mint上却不能正常工作?
EN

Stack Overflow用户
提问于 2018-07-21 20:06:39
回答 1查看 2.3K关注 0票数 5

我尝试将Codecov添加到我的library CI构建系统中。travis script如下所示:

代码语言:javascript
复制
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"

当我在本地Linux Mint机器上运行这些命令时,一切工作正常。但在Travis上却并非如此。Report看起来是这样的:

代码语言:javascript
复制
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

所以很明显这里有一个问题,但我不明白是什么。我不能在我的本地机器上复制它,在网上搜索我也找不到解决方案。

travis和我的本地机器都使用gcov 8.1.0。在travis上,我使用lcov 1.13,在我的本地机器上使用1.12版。我使用下面的flags进行编译

代码语言:javascript
复制
-Wall (... various warning flags) -m32 -g -O0 -fprofile-arcs -ftest-coverage --coverage

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

编辑:修复问题。看起来是gcc 8造成了一些问题。使用gcc 7就可以了。

EN

回答 1

Stack Overflow用户

发布于 2018-11-08 22:27:08

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

票数 5
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/51455904

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档