From 0dbfce76f18967258a1e4b47f79a426098dfa8e6 Mon Sep 17 00:00:00 2001 From: Andreas Waidler Date: Fri, 12 Mar 2010 22:58:58 +0100 Subject: [PATCH] Restructured test directories. --- configure.ac | 2 ++ tests/Makefile.am | 16 +++++++--------- tests/{ => framework}/AutoCreatedException.cxx | 2 +- tests/{ => framework}/AutoCreatedException.hxx | 0 tests/{ => framework}/CountingException.cxx | 2 +- tests/{ => framework}/CountingException.hxx | 0 tests/framework/Makefile.am | 9 +++++++++ tests/{ => framework}/MockException.cxx | 2 +- tests/{ => framework}/MockException.hxx | 0 tests/{ => framework}/UncloneableException.cxx | 2 +- tests/{ => framework}/UncloneableException.hxx | 0 tests/src/Makefile.am | 10 ++++++++++ tests/{ => src}/TestException.cxx | 6 +++--- tests/{ => src}/TestException.hxx | 0 tests/{ => src}/TestMacros.cxx | 4 ++-- tests/{ => src}/TestMacros.hxx | 0 tests/{ => src}/TestUtility.cxx | 7 ++----- tests/{ => src}/TestUtility.hxx | 3 --- tests/testRegistry.cxx | 6 +++--- 19 files changed, 42 insertions(+), 29 deletions(-) rename tests/{ => framework}/AutoCreatedException.cxx (79%) rename tests/{ => framework}/AutoCreatedException.hxx (100%) rename tests/{ => framework}/CountingException.cxx (88%) rename tests/{ => framework}/CountingException.hxx (100%) create mode 100644 tests/framework/Makefile.am rename tests/{ => framework}/MockException.cxx (77%) rename tests/{ => framework}/MockException.hxx (100%) rename tests/{ => framework}/UncloneableException.cxx (83%) rename tests/{ => framework}/UncloneableException.hxx (100%) create mode 100644 tests/src/Makefile.am rename tests/{ => src}/TestException.cxx (94%) rename tests/{ => src}/TestException.hxx (100%) rename tests/{ => src}/TestMacros.cxx (74%) rename tests/{ => src}/TestMacros.hxx (100%) rename tests/{ => src}/TestUtility.cxx (96%) rename tests/{ => src}/TestUtility.hxx (97%) diff --git a/configure.ac b/configure.ac index fd9e49f..940b856 100644 --- a/configure.ac +++ b/configure.ac @@ -229,6 +229,8 @@ AC_CONFIG_FILES([ include/libsex/Makefile src/Makefile tests/Makefile + tests/framework/Makefile + tests/src/Makefile ${PACKAGE}.pc ]) diff --git a/tests/Makefile.am b/tests/Makefile.am index fe5b889..162e4bf 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,19 +1,17 @@ if can_run_tests +SUBDIRS = framework src + check_PROGRAMS = tests TESTS = tests tests_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir) $(CPPUNIT_CFLAGS) tests_CXXFLAGS = $(CPPUNIT_LIBS) -tests_LDADD = $(top_srcdir)/src/$(PACKAGE).la -tests_SOURCES = main.cxx testRegistry.cxx \ - MockException.cxx \ - AutoCreatedException.cxx \ - CountingException.cxx \ - UncloneableException.cxx \ - TestException.cxx \ - TestUtility.cxx \ - TestMacros.cxx +tests_SOURCES = main.cxx testRegistry.cxx +tests_LDADD = \ + $(top_srcdir)/src/$(PACKAGE).la \ + framework/libframework.la \ + src/libtest.la else diff --git a/tests/AutoCreatedException.cxx b/tests/framework/AutoCreatedException.cxx similarity index 79% rename from tests/AutoCreatedException.cxx rename to tests/framework/AutoCreatedException.cxx index b84d4d8..b19f156 100644 --- a/tests/AutoCreatedException.cxx +++ b/tests/framework/AutoCreatedException.cxx @@ -1,4 +1,4 @@ -#include +#include #include // Do not change this! Here we're testing whether diff --git a/tests/AutoCreatedException.hxx b/tests/framework/AutoCreatedException.hxx similarity index 100% rename from tests/AutoCreatedException.hxx rename to tests/framework/AutoCreatedException.hxx diff --git a/tests/CountingException.cxx b/tests/framework/CountingException.cxx similarity index 88% rename from tests/CountingException.cxx rename to tests/framework/CountingException.cxx index a3aae59..757498b 100644 --- a/tests/CountingException.cxx +++ b/tests/framework/CountingException.cxx @@ -1,4 +1,4 @@ -#include +#include int CountingException::instances = 0; diff --git a/tests/CountingException.hxx b/tests/framework/CountingException.hxx similarity index 100% rename from tests/CountingException.hxx rename to tests/framework/CountingException.hxx diff --git a/tests/framework/Makefile.am b/tests/framework/Makefile.am new file mode 100644 index 0000000..10e87df --- /dev/null +++ b/tests/framework/Makefile.am @@ -0,0 +1,9 @@ +noinst_LTLIBRARIES = libframework.la +libframework_la_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir) $(CPPUNIT_CFLAGS) +libframework_la_CXXFLAGS = $(CPPUNIT_LIBS) +libframework_la_LIBADD = $(top_srcdir)/src/libsex.la +libframework_la_SOURCES = \ + AutoCreatedException.cxx \ + CountingException.cxx \ + MockException.cxx \ + UncloneableException.cxx diff --git a/tests/MockException.cxx b/tests/framework/MockException.cxx similarity index 77% rename from tests/MockException.cxx rename to tests/framework/MockException.cxx index 30eec58..88af2e9 100644 --- a/tests/MockException.cxx +++ b/tests/framework/MockException.cxx @@ -1,4 +1,4 @@ -#include +#include const char* const MockException::TEMPLATE = "%s=%d"; diff --git a/tests/MockException.hxx b/tests/framework/MockException.hxx similarity index 100% rename from tests/MockException.hxx rename to tests/framework/MockException.hxx diff --git a/tests/UncloneableException.cxx b/tests/framework/UncloneableException.cxx similarity index 83% rename from tests/UncloneableException.cxx rename to tests/framework/UncloneableException.cxx index 9eb094b..eb38c43 100644 --- a/tests/UncloneableException.cxx +++ b/tests/framework/UncloneableException.cxx @@ -1,4 +1,4 @@ -#include +#include UncloneableException::UncloneableException() : libsex::Exception("UncloneableException") { } diff --git a/tests/UncloneableException.hxx b/tests/framework/UncloneableException.hxx similarity index 100% rename from tests/UncloneableException.hxx rename to tests/framework/UncloneableException.hxx diff --git a/tests/src/Makefile.am b/tests/src/Makefile.am new file mode 100644 index 0000000..8833050 --- /dev/null +++ b/tests/src/Makefile.am @@ -0,0 +1,10 @@ +noinst_LTLIBRARIES = libtest.la +libtest_la_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir) $(CPPUNIT_CFLAGS) +libtest_la_CXXFLAGS = $(CPPUNIT_LIBS) +libtest_la_LIBADD = \ + $(top_srcdir)/src/libsex.la \ + $(top_srcdir)/tests/framework/libframework.la +libtest_la_SOURCES = \ + TestException.cxx \ + TestUtility.cxx \ + TestMacros.cxx diff --git a/tests/TestException.cxx b/tests/src/TestException.cxx similarity index 94% rename from tests/TestException.cxx rename to tests/src/TestException.cxx index 0643f6b..e0ba2a7 100644 --- a/tests/TestException.cxx +++ b/tests/src/TestException.cxx @@ -1,6 +1,6 @@ -#include -#include -#include +#include +#include +#include #include #include diff --git a/tests/TestException.hxx b/tests/src/TestException.hxx similarity index 100% rename from tests/TestException.hxx rename to tests/src/TestException.hxx diff --git a/tests/TestMacros.cxx b/tests/src/TestMacros.cxx similarity index 74% rename from tests/TestMacros.cxx rename to tests/src/TestMacros.cxx index d6a05fe..29d6741 100644 --- a/tests/TestMacros.cxx +++ b/tests/src/TestMacros.cxx @@ -1,5 +1,5 @@ -#include -#include +#include +#include #include diff --git a/tests/TestMacros.hxx b/tests/src/TestMacros.hxx similarity index 100% rename from tests/TestMacros.hxx rename to tests/src/TestMacros.hxx diff --git a/tests/TestUtility.cxx b/tests/src/TestUtility.cxx similarity index 96% rename from tests/TestUtility.cxx rename to tests/src/TestUtility.cxx index 377266d..1f4d7e0 100644 --- a/tests/TestUtility.cxx +++ b/tests/src/TestUtility.cxx @@ -1,11 +1,8 @@ -#include -#include +#include +#include #include -void TestUtility::setUp() {} -void TestUtility::tearDown() {} - void TestUtility::testShortTemplateWithoutFormatting() { char buf[100] = { 0 }; diff --git a/tests/TestUtility.hxx b/tests/src/TestUtility.hxx similarity index 97% rename from tests/TestUtility.hxx rename to tests/src/TestUtility.hxx index 8b097d4..f8c5ef1 100644 --- a/tests/TestUtility.hxx +++ b/tests/src/TestUtility.hxx @@ -20,9 +20,6 @@ CPPUNIT_TEST_SUITE(TestUtility); CPPUNIT_TEST_SUITE_END(); public: - void setUp(); - void tearDown(); - void testShortTemplateWithoutFormatting(); void testWhetherFalseIsReturnedWhenHeaderFillsBuffer(); void testWhetherTrueIsReturnedOnExactFit(); diff --git a/tests/testRegistry.cxx b/tests/testRegistry.cxx index fe0c060..4be49e8 100644 --- a/tests/testRegistry.cxx +++ b/tests/testRegistry.cxx @@ -3,11 +3,11 @@ // Registering all unit tests here, to make them // easier to disable and enable. -#include +#include CPPUNIT_TEST_SUITE_REGISTRATION(TestException); -#include +#include CPPUNIT_TEST_SUITE_REGISTRATION(TestUtility); -#include +#include CPPUNIT_TEST_SUITE_REGISTRATION(TestMacros); -- 2.11.4.GIT