gpt4 book ai didi

c++ - 为什么带有 lcov 的 codecov 在 Travis 上无法正常工作,但在我的本地 Linux Mint 上却无法正常工作?

转载 作者:行者123 更新时间:2023-12-01 17:20:45 59 4
gpt4 key购买 nike

我尝试添加Codecov到我的 CI 构建系统 librarytravis script看起来像这样:

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 机器上运行这些命令时,一切都按预期运行。但在特拉维斯上却并非如此。 Report看起来像这样:

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 进行编译:

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

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

编辑:解决了这个问题。看来 gcc 8 引起了一些问题。使用 gcc 7 效果很好。

最佳答案

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

关于c++ - 为什么带有 lcov 的 codecov 在 Travis 上无法正常工作,但在我的本地 Linux Mint 上却无法正常工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51455904/

59 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com