我有一些 .cpp 和 .h 文件驻留在路径中
~/NetBeansProjects/我的应用程序
main.cpp
person.cpp
person.h
我的 cppunit .cpp 和 .h 文件位于路径中
~/NetBeansProjects/myApplication/tests
TestCase.cpp
TestCase.h
finalresults.cpp
假设我在 ~ 并且我有 cd 到目录
/NetBeansProjects/myApplication in my terminal
我想对我的 cppunit 文件执行 g++ 以生成 cppunit 测试结果的 XML 报告。
我在 finalresults.cpp 中添加了 XmlOutputter
std::ofstream xmlFileOut("testResults.xml");
XmlOutputter xmlOut(&collectedresults, xmlFileOut);
xmlOut.write();
the command to use(as suggested) g++ -o finaltestresults person.cpp main.cpp tests/TestCase.cpp tests/finalresults.cpp -lcppunit
我的程序运行成功但没有创建 xml。
我需要执行哪些额外步骤?
最佳答案
g++ -o finalresults main.cpp person.cpp 测试/TestCase.cpp 测试/finalresults.cpp
-lcppunit
关于c++编译cppunit文件并执行xml报告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21142914/