From a17bb9f842aca9ad9b414237ad576aa7a887349e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= Date: Wed, 10 Jun 2009 19:56:53 +0200 Subject: Moved Swiften/QA/UnitTest to QA/UnitTest. diff --git a/Makefile b/Makefile index 0cddb30..d46ffb4 100644 --- a/Makefile +++ b/Makefile @@ -44,7 +44,7 @@ include 3rdParty/Expat/Makefile.inc include 3rdParty/SQLite/Makefile.inc include Swiften/Makefile.inc include Swift/Makefile.inc -include Swiften/QA/Makefile.inc +include QA/Makefile.inc ################################################################################ # Main targets diff --git a/QA/Makefile.inc b/QA/Makefile.inc new file mode 100644 index 0000000..e86005d --- /dev/null +++ b/QA/Makefile.inc @@ -0,0 +1,9 @@ +ifdef USE_VALGRIND +# Not enabled: --show-reachable=yes +TEST_RUNNER=valgrind --suppressions=QA/valgrind.supp -q --leak-check=full --track-origins=yes +endif + +include QA/UnitTest/Makefile.inc + +.PHONY: test +test: $(TEST_TARGETS) diff --git a/QA/UnitTest/Makefile.inc b/QA/UnitTest/Makefile.inc new file mode 100644 index 0000000..820fb64 --- /dev/null +++ b/QA/UnitTest/Makefile.inc @@ -0,0 +1,17 @@ +UNITTEST_TARGET = QA/UnitTest/checker +UNITTEST_SOURCES += \ + QA/UnitTest/checker.cpp +UNITTEST_OBJECTS = \ + $(UNITTEST_SOURCES:.cpp=.o) + +TEST_TARGETS += check + +CLEANFILES += $(UNITTEST_OBJECTS) $(UNITTEST_TARGET) + +.PHONY: check +check: $(UNITTEST_TARGET) + $(TEST_RUNNER) ./$(UNITTEST_TARGET) + +$(UNITTEST_TARGET): $(CPPUNIT_TARGET) $(UNITTEST_OBJECTS) $(UNITTEST_LIBS) $(BUNDLED_LIBS) + $(QUIET_LINK)$(CXX) -o $(UNITTEST_TARGET) $(UNITTEST_OBJECTS) $(LDFLAGS) $(CPPUNIT_TARGET) $(UNITTEST_LIBS) $(BUNDLED_LIBS) $(LIBS) + diff --git a/QA/UnitTest/checker.cpp b/QA/UnitTest/checker.cpp new file mode 100644 index 0000000..ea4f0d9 --- /dev/null +++ b/QA/UnitTest/checker.cpp @@ -0,0 +1,16 @@ +#include +#include +#include +#include +#include + +int main(int argc, char* argv[]) +{ + CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry(); + CppUnit::TextUi::TestRunner runner; + runner.addTest( registry.makeTest() ); + if (argc >= 2 && std::string(argv[1]) != std::string("--xml")) { + runner.setOutputter(new CppUnit::XmlOutputter(&runner.result(), std::cout)); + } + return (runner.run("") ? 0 : 1); +} diff --git a/QA/UnitTest/template/FooTest.cpp b/QA/UnitTest/template/FooTest.cpp new file mode 100644 index 0000000..b6b9abf --- /dev/null +++ b/QA/UnitTest/template/FooTest.cpp @@ -0,0 +1,24 @@ +#include +#include + +using namespace Swift; + +class FooTest : public CppUnit::TestFixture { + CPPUNIT_TEST_SUITE(FooTest); + CPPUNIT_TEST(testBar); + CPPUNIT_TEST_SUITE_END(); + + public: + FooTest() {} + + void setUp() { + } + + void tearDown() { + } + + void testBar() { + } +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(FooTest); diff --git a/QA/valgrind.supp b/QA/valgrind.supp new file mode 100644 index 0000000..5e2ee00 --- /dev/null +++ b/QA/valgrind.supp @@ -0,0 +1,51 @@ +{ + ZLib doesn't allocate its buffer. This is no bug according to the FAQ. + Memcheck:Cond + fun:longest_match + fun:deflate_slow + fun:deflate +} + +{ + Not sure why this happens. + Memcheck:Leak + fun:calloc + fun:_dl_allocate_tls + fun:pthread_create@@GLIBC_2.1 + fun:_ZN5boost6thread12start_threadEv +} + +{ + + Memcheck:Param + socketcall.sendto(msg) + fun:sendto + fun:getaddrinfo +} + +{ + + Memcheck:Cond + fun:BN_bin2bn +} + +{ + + Memcheck:Cond + fun:BN_num_bits_word +} + +{ + + Memcheck:Value4 + fun:BN_mod_exp_mont_consttime + fun:BN_mod_exp_mont +} + +{ + + Memcheck:Value4 + fun:BN_num_bits_word + fun:BN_mod_exp_mont_consttime + fun:BN_mod_exp_mont +} diff --git a/Swiften/Makefile.inc b/Swiften/Makefile.inc index bb93bf8..12323db 100644 --- a/Swiften/Makefile.inc +++ b/Swiften/Makefile.inc @@ -42,4 +42,5 @@ lib: $(SWIFTEN_TARGET) $(SWIFTEN_TARGET): $(SWIFTEN_OBJECTS) $(QUIET_AR)$(AR) $(ARFLAGS) $@ $(SWIFTEN_OBJECTS) +include Swiften/QA/Makefile.inc include Swiften/Examples/Makefile.inc diff --git a/Swiften/QA/Makefile.inc b/Swiften/QA/Makefile.inc index dc3a0bf..831b443 100644 --- a/Swiften/QA/Makefile.inc +++ b/Swiften/QA/Makefile.inc @@ -1,11 +1,2 @@ -ifdef USE_VALGRIND -# Not enabled: --show-reachable=yes -TEST_RUNNER=valgrind --suppressions=Swiften/QA/valgrind.supp -q --leak-check=full --track-origins=yes -endif - -include Swiften/QA/UnitTest/Makefile.inc include Swiften/QA/NetworkTest/Makefile.inc include Swiften/QA/ClientTest/Makefile.inc - -.PHONY: test -test: $(TEST_TARGETS) diff --git a/Swiften/QA/NetworkTest/Makefile.inc b/Swiften/QA/NetworkTest/Makefile.inc index 3638f2f..055937b 100644 --- a/Swiften/QA/NetworkTest/Makefile.inc +++ b/Swiften/QA/NetworkTest/Makefile.inc @@ -2,7 +2,7 @@ NETWORKTEST_TARGET += Swiften/QA/NetworkTest/checker NETWORKTEST_SOURCES += \ Swiften/QA/NetworkTest/DomainNameResolverTest.cpp \ Swiften/QA/NetworkTest/BoostConnectionTest.cpp \ - Swiften/QA/UnitTest/checker.cpp + QA/UnitTest/checker.cpp NETWORKTEST_OBJECTS = \ $(NETWORKTEST_SOURCES:.cpp=.o) diff --git a/Swiften/QA/UnitTest/Makefile.inc b/Swiften/QA/UnitTest/Makefile.inc deleted file mode 100644 index 5bdbec9..0000000 --- a/Swiften/QA/UnitTest/Makefile.inc +++ /dev/null @@ -1,17 +0,0 @@ -UNITTEST_TARGET = Swiften/QA/UnitTest/checker -UNITTEST_SOURCES += \ - Swiften/QA/UnitTest/checker.cpp -UNITTEST_OBJECTS = \ - $(UNITTEST_SOURCES:.cpp=.o) - -TEST_TARGETS += check - -CLEANFILES += $(UNITTEST_OBJECTS) $(UNITTEST_TARGET) - -.PHONY: check -check: $(UNITTEST_TARGET) - $(TEST_RUNNER) ./$(UNITTEST_TARGET) - -$(UNITTEST_TARGET): $(CPPUNIT_TARGET) $(UNITTEST_OBJECTS) $(UNITTEST_LIBS) $(BUNDLED_LIBS) - $(QUIET_LINK)$(CXX) -o $(UNITTEST_TARGET) $(UNITTEST_OBJECTS) $(LDFLAGS) $(CPPUNIT_TARGET) $(UNITTEST_LIBS) $(BUNDLED_LIBS) $(LIBS) - diff --git a/Swiften/QA/UnitTest/checker.cpp b/Swiften/QA/UnitTest/checker.cpp deleted file mode 100644 index ea4f0d9..0000000 --- a/Swiften/QA/UnitTest/checker.cpp +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include -#include -#include - -int main(int argc, char* argv[]) -{ - CppUnit::TestFactoryRegistry& registry = CppUnit::TestFactoryRegistry::getRegistry(); - CppUnit::TextUi::TestRunner runner; - runner.addTest( registry.makeTest() ); - if (argc >= 2 && std::string(argv[1]) != std::string("--xml")) { - runner.setOutputter(new CppUnit::XmlOutputter(&runner.result(), std::cout)); - } - return (runner.run("") ? 0 : 1); -} diff --git a/Swiften/QA/UnitTest/template/FooTest.cpp b/Swiften/QA/UnitTest/template/FooTest.cpp deleted file mode 100644 index b6b9abf..0000000 --- a/Swiften/QA/UnitTest/template/FooTest.cpp +++ /dev/null @@ -1,24 +0,0 @@ -#include -#include - -using namespace Swift; - -class FooTest : public CppUnit::TestFixture { - CPPUNIT_TEST_SUITE(FooTest); - CPPUNIT_TEST(testBar); - CPPUNIT_TEST_SUITE_END(); - - public: - FooTest() {} - - void setUp() { - } - - void tearDown() { - } - - void testBar() { - } -}; - -CPPUNIT_TEST_SUITE_REGISTRATION(FooTest); diff --git a/Swiften/QA/valgrind.supp b/Swiften/QA/valgrind.supp deleted file mode 100644 index 5e2ee00..0000000 --- a/Swiften/QA/valgrind.supp +++ /dev/null @@ -1,51 +0,0 @@ -{ - ZLib doesn't allocate its buffer. This is no bug according to the FAQ. - Memcheck:Cond - fun:longest_match - fun:deflate_slow - fun:deflate -} - -{ - Not sure why this happens. - Memcheck:Leak - fun:calloc - fun:_dl_allocate_tls - fun:pthread_create@@GLIBC_2.1 - fun:_ZN5boost6thread12start_threadEv -} - -{ - - Memcheck:Param - socketcall.sendto(msg) - fun:sendto - fun:getaddrinfo -} - -{ - - Memcheck:Cond - fun:BN_bin2bn -} - -{ - - Memcheck:Cond - fun:BN_num_bits_word -} - -{ - - Memcheck:Value4 - fun:BN_mod_exp_mont_consttime - fun:BN_mod_exp_mont -} - -{ - - Memcheck:Value4 - fun:BN_num_bits_word - fun:BN_mod_exp_mont_consttime - fun:BN_mod_exp_mont -} -- cgit v0.10.2-6-g49f6