gpt4 book ai didi

code-coverage - Lcov 不一致的覆盖范围

转载 作者:行者123 更新时间:2023-12-03 22:45:09 24 4
gpt4 key购买 nike

我开始使用 lcov大约一个月后。覆盖计数似乎不一致。第一次运行报告了大约 75% 的线路覆盖率,而第二次运行仅报告了 19%。两次运行都使用了一些测试套件。我在 lcov --remove 期间看到以下警告.有什么建议吗?

lcov: WARNING: negative counts found in tracefile all.info



这是需要担心的吗?

最佳答案

同知 issue在 GitHub 上报告了这里。

Replacing all counts of -1 in the output with 0 (e.g. with sed -i -e 's/,-1$/,0/g' <outputfile>) causes the warning to disappear from the lcov and genhtml output while still producing the correct coverage report.

More importantly (at least for me), submitting the file with the counts set to 0 instead of -1 to codecov.io results in the results being parsed correctly and the coverage information being available through codecov.io.



Codecov还处理这种值错误:
# Fix negative counts
$count = $2 < 0 ? 0 : $2;
if ($2 < 0)
{
$negative = 1;
}

遵循一些其他修复:
  • Fix Undocumented Value
  • Remove fix for negative coverage counts
  • 关于code-coverage - Lcov 不一致的覆盖范围,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25585895/

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