Hudson, C++ and UnitTest++ Hudson, C++ and UnitTest++ jenkins jenkins

Hudson, C++ and UnitTest++


We are actively doing this at my workplace.

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

  • 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

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.


I checked the xUnit plugin, as Patrick Johnmeyer suggested in the accepted answer. For completeness sakes, here is the driver code:

#include <fstream>#include "UnitTest++.h"#include "XmlTestReporter.h"int main( int argc, char *argc[] ) {    std::ofstream f("file.xml");    UnitTest::XmlTestReporter reporter(f);    return UnitTest::RunAllTests(reporter, UnitTest::Test::GetTestList(), NULL, 0);}

In Hudson configuration, check "Publish testing tools result report" and point it to "file.xml"