Has anyone used Hudson as a Continuous-Integration server for a C++ project using UnitTest++ as a testing library?
How exactly did you set it up?
I know there have been several questions on Continuous Integration before, but I hope this one has a narrower scope.
EDIT: 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:
main()
, thus treated as build errorsI 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"
Hudson now has a CppUnit plugin that may do the trick.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With