c++ - How to launch cppunit test? -
i trying run cppunit first time following error. have installed think there problem cppunit-config has idea how fix this? have seen report bug on nebeans don't know how run cppunit-config terminal?
https://netbeans.org/bugzilla/show_bug.cgi?id=230617
"/usr/bin/make" -f nbproject/makefile-debug.mk qmake= subprojects= .build-conf "/usr/bin/make" -f nbproject/makefile-debug.mk dist/debug/gnu-macosx/exercise1 make[2]: `dist/debug/gnu-macosx/exercise1' date. "/usr/bin/make" -f nbproject/makefile-debug.mk subprojects= .build-tests-conf "/usr/bin/make" -f nbproject/makefile-debug.mk dist/debug/gnu-macosx/exercise1 make[2]: `dist/debug/gnu-macosx/exercise1' date. mkdir -p build/debug/gnu-macosx/tests/testfiles g++ -o build/debug/gnu-macosx/tests/testfiles/f1 build/debug/gnu-macosx/tests/tests/newtestclass.o build/debug/gnu-macosx/tests/tests/newtestrunner.o build/debug/gnu-macosx/main_nomain.o `cppunit-config --libs` /bin/sh: cppunit-config: command not found undefined symbols architecture x86_64: "cppunit::testresult::addlistener(cppunit::testlistener*)", referenced from: _main in newtestrunner.o "cppunit::testresult::testresult(cppunit::synchronizedobject::synchronizationobject*)", referenced from: _main in newtestrunner.o "cppunit::testresult::~testresult()", referenced from: _main in newtestrunner.o "cppunit::testrunner::run(cppunit::testresult&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from: _main in newtestrunner.o "cppunit::testrunner::addtest(cppunit::test*)", referenced from: _main in newtestrunner.o "cppunit::testrunner::testrunner()", referenced from: _main in newtestrunner.o "cppunit::testrunner::~testrunner()", referenced from: _main in newtestrunner.o "cppunit::compileroutputter::write()", referenced from: _main in newtestrunner.o "cppunit::compileroutputter::compileroutputter(cppunit::testresultcollector*, std::basic_ostream<char, std::char_traits<char> >&, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from: _main in newtestrunner.o "cppunit::compileroutputter::~compileroutputter()", referenced from: _main in newtestrunner.o "cppunit::testfactoryregistry::getregistry(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from: cppunit::autoregistersuite<newtestclass>::autoregistersuite()in newtestclass.o _main in newtestrunner.o "cppunit::testfactoryregistry::registerfactory(cppunit::testfactory*)", referenced from: cppunit::autoregistersuite<newtestclass>::autoregistersuite()in newtestclass.o "cppunit::testfactoryregistry::unregisterfactory(cppunit::testfactory*)", referenced from: cppunit::autoregistersuite<newtestclass>::~autoregistersuite()in newtestclass.o "cppunit::testfactoryregistry::isvalid()", referenced from: cppunit::autoregistersuite<newtestclass>::~autoregistersuite()in newtestclass.o "cppunit::testresultcollector::testresultcollector(cppunit::synchronizedobject::synchronizationobject*)", referenced from: _main in newtestrunner.o "cppunit::testresultcollector::~testresultcollector()", referenced from: _main in newtestrunner.o "cppunit::brieftestprogresslistener::brieftestprogresslistener()", referenced from: _main in newtestrunner.o "cppunit::brieftestprogresslistener::~brieftestprogresslistener()", referenced from: _main in newtestrunner.o "cppunit::testsuitebuildercontextbase::addtest(cppunit::test*)", referenced from: newtestclass::addteststosuite(cppunit::testsuitebuildercontextbase&) in newtestclass.o "cppunit::testsuitebuildercontextbase::testsuitebuildercontextbase(cppunit::testsuite&, cppunit::testnamer const&, cppunit::testfixturefactory&)", referenced from: newtestclass::suite() in newtestclass.o "cppunit::testsuitebuildercontextbase::~testsuitebuildercontextbase()", referenced from: newtestclass::suite() in newtestclass.o "cppunit::testsuitebuildercontextbase::~testsuitebuildercontextbase()", referenced from: cppunit::testsuitebuildercontext<newtestclass>::~testsuitebuildercontext()in newtestclass.o cppunit::testsuitebuildercontext<newtestclass>::~testsuitebuildercontext()in newtestclass.o "cppunit::testcase::run(cppunit::testresult*)", referenced from: vtable cppunit::testcaller<newtestclass>in newtestclass.o "cppunit::testcase::testcase(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)", referenced from: cppunit::testcaller<newtestclass>::testcaller(std::basic_string<char, std::char_traits<char>, std::allocator<char> >, void (newtestclass::*)(), newtestclass*)in newtestclass.o "cppunit::testcase::~testcase()", referenced from: cppunit::testcaller<newtestclass>::~testcaller()in newtestclass.o cppunit::testcaller<newtestclass>::~testcaller()in newtestclass.o "cppunit::testnamer::testnamer(std::type_info const&)", referenced from: newtestclass::gettestnamer__() in newtestclass.o "cppunit::testnamer::~testnamer()", referenced from: ___tcf_0 in newtestclass.o "cppunit::testsuite::testsuite(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)", referenced from: newtestclass::suite() in newtestclass.o "cppunit::testsuccesslistener::wassuccessful() const", referenced from: _main in newtestrunner.o "cppunit::testsuitebuildercontextbase::gettestnamefor(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from: newtestclass::addteststosuite(cppunit::testsuitebuildercontextbase&) in newtestclass.o "cppunit::testsuitebuildercontextbase::maketestfixture() const", referenced from: cppunit::testsuitebuildercontext<newtestclass>::makefixture() const in newtestclass.o "cppunit::test::findtestpath(cppunit::test const*, cppunit::testpath&) const", referenced from: vtable cppunit::testcaller<newtestclass>in newtestclass.o "cppunit::test::findtestpath(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, cppunit::testpath&) const", referenced from: vtable cppunit::testcaller<newtestclass>in newtestclass.o "cppunit::test::getchildtestat(int) const", referenced from: vtable cppunit::testcaller<newtestclass>in newtestclass.o "cppunit::test::resolvetestpath(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from: vtable cppunit::testcaller<newtestclass>in newtestclass.o "cppunit::test::checkisvalidindex(int) const", referenced from: vtable cppunit::testcaller<newtestclass>in newtestclass.o "cppunit::test::findtest(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) const", referenced from: vtable cppunit::testcaller<newtestclass>in newtestclass.o "cppunit::testcase::getname() const", referenced from: vtable cppunit::testcaller<newtestclass>in newtestclass.o "cppunit::testleaf::counttestcases() const", referenced from: vtable cppunit::testcaller<newtestclass>in newtestclass.o "cppunit::testleaf::dogetchildtestat(int) const", referenced from: vtable cppunit::testcaller<newtestclass>in newtestclass.o "cppunit::testleaf::getchildtestcount() const", referenced from: vtable cppunit::testcaller<newtestclass>in newtestclass.o "typeinfo cppunit::testsuitebuildercontextbase", referenced from: typeinfo cppunit::testsuitebuildercontext<newtestclass>in newtestclass.o "typeinfo cppunit::testcase", referenced from: typeinfo cppunit::testcaller<newtestclass>in newtestclass.o "vtable cppunit::testsuitebuildercontextbase", referenced from: cppunit::testsuitebuildercontextbase::testsuitebuildercontextbase(cppunit::testsuitebuildercontextbase const&)in newtestclass.o note: missing vtable means first non-inline virtual member function has no definition. ld: symbol(s) not found architecture x86_64 collect2: ld returned 1 exit status make[1]: *** [build/debug/gnu-macosx/tests/testfiles/f1] error 1 make: *** [.build-tests-impl] error 2 build tests failed (exit value 2, total time: 236ms)
ran same problem, , found solution after digging in web. in case, have cppunit installed homebrew on mavericks, , netbeans version 8.1. op mentioned, netbeans complains /bin/sh: cppunit-config: command not found
though can run cppunit-config
terminal. eliminates path related concerns. running netbeans terminal temp fix found that there real fix that.
steps:
- in projects view under
test files
folder, right-click on test folder , goproperties
. (if don't have test folder yet, right-click ontest files
,new cppunit test
) - go
linker
section , click onlibraries
- you see lines starting
cppunit-
, remove them all add option
, selectother option
, type in-lcunit
- click on
ok
.
now, right-click on test folder, , test
command should run test properly.
Comments
Post a Comment