哈德森、C++ 和 UnitTest++

有没有人使用 Hudson 作为使用 UnitTest++ 作为测试库?

Has anyone used Hudson as a Continuous-Integration server for a C++ project using UnitTest++ as a testing library?

你是怎么设置的?

我知道之前有几个关于持续集成的问题,但我希望这个问题的范围更窄.

I know there have been several questions on Continuous Integration before, but I hope this one has a narrower scope.

我会澄清一下我在寻找什么.当单元测试失败时,我已经将构建设置失败.我正在寻找像 Hudson 的 JUnit 支持这样的东西.UnitTest++ 可以创建 XML 报告(参见这里).所以,也许如果有人知道如何将这些报告翻译成与 JUnit 兼容,Hudson 就会知道如何吃掉它?

I'll clarify a bit on what I'm looking for. I already have the build set to fail when the Unit-Tests fail. I'm looking for something like Hudson's JUnit support. UnitTest++ can create XML reports (See here). So, perhaps if someone knows how to translate these reports to be JUnit compatible, Hudson will know how to eat it up?

推荐答案

我们正在我的工作场所积极地这样做.

We are actively doing this at my workplace.

目前,我们使用自由风格的软件项目来:

Currently, we use a free-style software project to:

  • 每 15 分钟检查一次我们的 Subversion 存储库以获取更新
  • 调用 Windows 批处理文件来清理和构建解决方案文件
    • 项目文件作为构建后事件构建和运行单元测试
    • 单元测试失败由测试main()返回,因此被视为构建错误
    • Check our Subversion repository for updates every 15 minutes
    • Call a windows batch file to clean and build a solution file
      • Project files build and run unit tests as a post-build event
      • Unit test failures are returned by the test main(), thus treated as build errors

      我还测试了使用 UnitTest++ 中包含的 XmlTestReporter 生成输出文件的配置.xUnit 插件 原生支持此输出,以及您可以使用的任何其他输出转换,虽然我不得不更改版本 0.1.3 中随附的 XSL 文件以获取测试历史记录中记录的持续时间.

      I have also tested a configuration that uses the XmlTestReporter included with UnitTest++ to generate output files. The xUnit plugin natively supports this output, along with any other output you can convert, although I had to change the XSL file that came with it in version 0.1.3 to get durations recorded in the test history.

      关于我们的集成,我们有很多想要改进的地方;构建日志很长且难以解析,没有着色或突出显示等,但到目前为止它仍然对我们有益.

      There are a lot of things we would like to improve about our integration; the build logs are long and hard to parse with no coloring or highlighting, etc., but so far it has still been beneficial to us.

相关文章