Hudson, C++ and UnitTest++

前端 未结 6 893
迷失自我
迷失自我 2021-01-30 02:53

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 ha

6条回答
  •  无人及你
    2021-01-30 03:11

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

    #include 
    #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"

提交回复
热议问题