diff options
author | Remko Tronçon <git@el-tramo.be> | 2009-06-10 17:56:53 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2009-06-10 18:13:11 (GMT) |
commit | a17bb9f842aca9ad9b414237ad576aa7a887349e (patch) | |
tree | 08ed44da292d4ff82def9f0b135a17e20536b7b8 /QA | |
parent | e2f5588d089e4d2148762ea092e032976254a467 (diff) | |
download | swift-contrib-a17bb9f842aca9ad9b414237ad576aa7a887349e.zip swift-contrib-a17bb9f842aca9ad9b414237ad576aa7a887349e.tar.bz2 |
Moved Swiften/QA/UnitTest to QA/UnitTest.
Diffstat (limited to 'QA')
-rw-r--r-- | QA/Makefile.inc | 9 | ||||
-rw-r--r-- | QA/UnitTest/Makefile.inc | 17 | ||||
-rw-r--r-- | QA/UnitTest/checker.cpp | 16 | ||||
-rw-r--r-- | QA/UnitTest/template/FooTest.cpp | 24 | ||||
-rw-r--r-- | QA/valgrind.supp | 51 |
5 files changed, 117 insertions, 0 deletions
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 <string> +#include <cppunit/ui/text/TestRunner.h> +#include <cppunit/extensions/TestFactoryRegistry.h> +#include <cppunit/XmlOutputter.h> +#include <cppunit/TextTestResult.h> + +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 <cppunit/extensions/HelperMacros.h> +#include <cppunit/extensions/TestFactoryRegistry.h> + +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 +} + +{ + <insert a suppression name here> + Memcheck:Param + socketcall.sendto(msg) + fun:sendto + fun:getaddrinfo +} + +{ + <insert a suppression name here> + Memcheck:Cond + fun:BN_bin2bn +} + +{ + <insert a suppression name here> + Memcheck:Cond + fun:BN_num_bits_word +} + +{ + <insert a suppression name here> + Memcheck:Value4 + fun:BN_mod_exp_mont_consttime + fun:BN_mod_exp_mont +} + +{ + <insert a suppression name here> + Memcheck:Value4 + fun:BN_num_bits_word + fun:BN_mod_exp_mont_consttime + fun:BN_mod_exp_mont +} |