gpt4 book ai didi

c++ - Jenkins 测试报告分析器与 catch 的集成

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:47:07 24 4
gpt4 key购买 nike

我最近开始使用 Jenkins 自动构建我的 C++ 项目并运行我的测试(我使用的是 catch.cpp)。

我想要某种测试运行时间和状态的表格,这让我找到了 Jenkins 的“测试结果分析器”插件。

我的构建是这样运行的: running the tests

您可以在控制台输出中看到它们实际运行: build console output

最后,我的测试结果分析器插件什么也没显示: no tests on the plugin page

插件似乎无法识别这些是我的测试。这是合理的,因为我只告诉 Jenkins 执行这些命令,我​​认为理解这些是要报告的测试还不够聪明。但我找不到如何告诉“测试报告分析器”它需要报告哪些测试。

我的问题是如何获得插件网页中的测试表:

Tests Reports Analyzer

解决方案:

Jenkins 需要一个测试结果的 Junit 格式的 xml 文件。

具体来说,在 Catch.cpp 中,这是通过“-r junit”命令行选项实现的。

在此之后,我需要将 jenkins 配置为“发布 JUnit 测试结果报告”后构建操作,并将其作为我使用“make test”命令创建的输出 xml 文件的路径。

最佳答案

OP提供的解决方案:

Jenkins needs a Junit format xml file of the test results.

specifically, in Catch.cpp this is achieved by the "-r junit" command line option.

after this i needed to configure jenkins to "Publish JUnit test result report" post-build action and git it a path to the output xml file i create with my "make test" command.

关于c++ - Jenkins 测试报告分析器与 catch 的集成,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37251427/

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