Со старта написал вот такой main.cpp (был взят из примера):
Код: Выделить всё
#include <iostream>
#include <cstdlib>
#include <cppunit>
#include <cppunit>
#include <cppunit>
#include <cppunit>
#include "testconfigurator/testconfigurator.h"
int main()
{
CppUnit::Test *suite = CppUnit::TestFactoryRegistry::getRegistry().makeTest();
CppUnit::TextUi::TestRunner runner;
runner.addTest(suite);
runner.setOutputter(new CppUnit::CompilerOutputter(&runner.result(), std::cout));
bool wasSuccessfull = runner.run();
if (!wasSuccessfull != 0) std::cout << "Error" << std::endl;
std::cout << "[OVAL] Cppunit-result ="<< !wasSuccessfull << std::endl;
return EXIT_SUCCESS;
}
Код: Выделить всё
#ifndef TESTCONFIGURATOR_H
#define TESTCONFIGURATOR_H
#include <cppunit>
#include <cppunit>
class TestConfigurator : public CppUnit::TestFixture {
CPPUNIT_TEST_SUITE(TestConfigurator);
CPPUNIT_TEST(test1);
CPPUNIT_TEST_SUITE_END();
private:
public:
void setUp();
void tearDown();
void test1();
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestConfigurator);
#endif
cd '/home/sirex/proj/stars/test' && WANT_AUTOCONF_2_5="1" WANT_AUTOMAKE_1_6="1" make test
/bin/sh ../libtool --tag=CXX --mode=link g++ -g -O2 -o test main.o ../test/testconfigurator/libtestConfigurator.la -lcppunit -ldl
g++ -g -O2 -o test main.o ../test/testconfigurator/.libs/libtestConfigurator.a /usr/lib/libcppunit.so -ldl
main.o: In function `TestConfigurator':
testconfigurator/testconfigurator.h:28: undefined reference to `vtable for TestConfigurator'
main.o: In function `TestConfigurator::getTestNamer__()':
testconfigurator/testconfigurator.h:29: undefined reference to `typeinfo for TestConfigurator'
testconfigurator/testconfigurator.h:29: undefined reference to `typeinfo for TestConfigurator'
collect2: ld returned 1 exit status
make: *** [test] Ошибка 1
*** Завершено с кодом: 2 ***
Причем, если в testconfigurator.h закомментировать "CPPUNIT_TEST_SUITE_REGISTRATION(TestConfigurator);", то всё впорядке.
Что ему не нравиться?