【问题标题】:How to set test duration in cppUnit xml report for Jenkins?如何在 Jenkins 的 cppUnit xml 报告中设置测试持续时间?
【发布时间】:2013-12-03 18:36:40
【问题描述】:

我使用 cppUnit 测试框架,使用 Jenkins 进行持续集成。我已经为 Jenkins 设置了 xUnit 插件来解析 xml 测试报告,它工作正常。

只有一个问题:cppUnit xml 输出器没有添加测试持续时间来报告。我可以通过 CppUnit::XmlOutputterHook 来完成,但我不知道要添加什么。

当我尝试做类似的事情时

<Test id="1">
  <Name>test_0001</Name>
  <Time>0.01</Time>
</Test>

然后Jenkins报错:

[xUnit] [ERROR] - The result file '<file name here>' for the metric 'CppUnit' is not valid. The result file has been skipped.

所以,我的问题是:如何为具有测试持续时间的 xUnit Jenkins 插件报告有效的 cppUnit xml?

【问题讨论】:

    标签: unit-testing jenkins continuous-integration xunit cppunit


    【解决方案1】:

    我已经通过使用带有custom stylesheet 的“自定义工具”报告类型而不是 xUnit 插件中的“CppUnit-1.12.1”解决了这个问题

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-27
      • 2021-12-21
      • 2023-01-03
      • 2021-03-03
      相关资源
      最近更新 更多