C++??????????unittest++???С??
???????????? ???????[ 2013/8/30 14:45:29 ] ????????
????UnitTest++?????C++???????????????????С?????ü?.???????????????????????xml???.
????????????????:http://unittest-cpp.sourceforge.net/UnitTest++.html
???????????????汾1.4
????????????:linux fedora64 2.6.35.6
??????y???:
????1.???????ù?????????????????.
????2.???????????make????????????libUnitTest++.a
????3.?????????????????TestUnitTest++.cpp?У?????????????????????????????????÷???.
???????????????????????:
????TEST(????????????)
????{
??????????????
????}
??????????Χ??????????????????
?????????????????????????????????????????:
????CHECK:?????????
????CHECK_EQUAL:?????????
????CHECK_CLOSE:????????
????4.??÷???:
????????????????????????????????д????????????????????????????????????libUnitTest++.a.
????????:
???????????????2?????: func.h func.cpp
????????h??????????????add??multi
????cpp????????????
??????????????д????????????????test.cpp
???????????????????UnitTest++.h????????????????????????????TestReporterStdout.h?????????????xml????У????
????????XmlTestReporter.h
????????????????????????μ?src/tests/Main.cpp
????????????xml???????main?????????????д:
int main(int argc?? char** argv)
{
//for xml output
ofstream ofile("./test.xml");
UnitTest::XmlTestReporter reporter(ofile);
UnitTest::TestRunner runner(reporter);
return runner.RunTestsIf(UnitTest::Test::GetTestList()??NULL??UnitTest::True()??0);
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11