diff --git a/configure.ac b/configure.ac index 1f408060f4..b0599afb2c 100644 --- a/configure.ac +++ b/configure.ac @@ -219,6 +219,7 @@ AC_CONFIG_FILES([Makefile src/lib/python/isc/config/Makefile src/lib/python/isc/Util/Makefile src/lib/config/Makefile + src/lib/config/unittests/Makefile src/lib/dns/Makefile src/lib/dns/tests/Makefile src/lib/exceptions/Makefile @@ -245,7 +246,7 @@ AC_OUTPUT([src/bin/cfgmgr/b10-cfgmgr.py src/bin/msgq/msgq_test src/bin/msgq/run_msgq.sh src/bin/auth/spec_config.h - src/lib/config/data_def_unittests_config.h + src/lib/config/unittests/data_def_unittests_config.h src/lib/python/isc/config/unittests/config_test src/lib/dns/gen-rdatacode.py src/lib/dns/tests/testdata/gen-wiredata.py diff --git a/src/bin/auth/Makefile.am b/src/bin/auth/Makefile.am index e3948f33c4..79a836f4e6 100644 --- a/src/bin/auth/Makefile.am +++ b/src/bin/auth/Makefile.am @@ -12,7 +12,7 @@ b10_auth_SOURCES += common.h b10_auth_SOURCES += main.cc b10_auth_LDADD = $(top_builddir)/src/lib/auth/.libs/libauth.a b10_auth_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns.a -b10_auth_LDADD += $(top_builddir)/src/lib/config/libcfgclient.a +b10_auth_LDADD += $(top_builddir)/src/lib/config/.libs/libcfgclient.a b10_auth_LDADD += $(top_builddir)/src/lib/cc/libcc.a b10_auth_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a b10_auth_LDADD += $(SQLITE_LIBS) diff --git a/src/bin/auth/tests/Makefile.am b/src/bin/auth/tests/Makefile.am index 9b42db7f8c..d11a183ef7 100644 --- a/src/bin/auth/tests/Makefile.am +++ b/src/bin/auth/tests/Makefile.am @@ -16,7 +16,7 @@ run_unittests_LDADD = $(GTEST_LDADD) run_unittests_LDADD += $(SQLITE_LIBS) run_unittests_LDADD += $(top_builddir)/src/lib/auth/.libs/libauth.a run_unittests_LDADD += $(top_builddir)/src/lib/dns/.libs/libdns.a -run_unittests_LDADD += $(top_builddir)/src/lib/config/libcfgclient.a +run_unittests_LDADD += $(top_builddir)/src/lib/config/.libs/libcfgclient.a run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.a run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/.libs/libexceptions.a if HAVE_BOOSTLIB diff --git a/src/lib/config/Makefile.am b/src/lib/config/Makefile.am index cdd4a274d4..14c548fa2b 100644 --- a/src/lib/config/Makefile.am +++ b/src/lib/config/Makefile.am @@ -1,21 +1,11 @@ AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext -lib_LIBRARIES = libcfgclient.a -libcfgclient_a_SOURCES = config_data.h config_data.cc module_spec.h module_spec.cc ccsession.cc ccsession.h +lib_LTLIBRARIES = libcfgclient.la +libcfgclient_la_SOURCES = config_data.h config_data.cc module_spec.h module_spec.cc ccsession.cc ccsession.h CLEANFILES = *.gcno *.gcda TESTS = if HAVE_GTEST -TESTS += run_unittests -run_unittests_SOURCES = module_spec_unittests.cc config_data_unittests.cc run_unittests.cc -run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) -run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) -run_unittests_LDADD = libcfgclient.a $(GTEST_LDADD) -run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la -run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.a +SUBDIRS = . unittests endif - -noinst_PROGRAMS = $(TESTS) - - diff --git a/src/lib/config/data_def_unittests_config.h.in b/src/lib/config/data_def_unittests_config.h.in deleted file mode 100644 index 223550bfb2..0000000000 --- a/src/lib/config/data_def_unittests_config.h.in +++ /dev/null @@ -1 +0,0 @@ -#define TEST_DATA_PATH "@abs_srcdir@/testdata" diff --git a/src/lib/config/unittests/Makefile.am b/src/lib/config/unittests/Makefile.am new file mode 100644 index 0000000000..ad049b67a0 --- /dev/null +++ b/src/lib/config/unittests/Makefile.am @@ -0,0 +1,22 @@ +AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/ext + +CLEANFILES = *.gcno *.gcda + +TESTS = +if HAVE_GTEST +TESTS += run_unittests +run_unittests_SOURCES = module_spec_unittests.cc config_data_unittests.cc run_unittests.cc +run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) +run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS) +run_unittests_LDADD = $(top_builddir)/src/lib/config/libcfgclient.la $(GTEST_LDADD) +run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la +run_unittests_LDADD += $(top_builddir)/src/lib/cc/libcc.a + +if HAVE_BOOSTLIB +run_unittests_LDFLAGS = $(AM_LDFLAGS) $(BOOST_LDFLAGS) +run_unittests_LDADD += $(BOOST_SYSTEM_LIB) +endif + +endif + +noinst_PROGRAMS = $(TESTS) diff --git a/src/lib/config/config_data_unittests.cc b/src/lib/config/unittests/config_data_unittests.cc similarity index 99% rename from src/lib/config/config_data_unittests.cc rename to src/lib/config/unittests/config_data_unittests.cc index 1cb1a50fe1..906de617b1 100644 --- a/src/lib/config/config_data_unittests.cc +++ b/src/lib/config/unittests/config_data_unittests.cc @@ -17,8 +17,8 @@ #include -#include "config_data.h" #include "data_def_unittests_config.h" +#include #include diff --git a/src/lib/config/unittests/data_def_unittests_config.h.in b/src/lib/config/unittests/data_def_unittests_config.h.in new file mode 100644 index 0000000000..2554296891 --- /dev/null +++ b/src/lib/config/unittests/data_def_unittests_config.h.in @@ -0,0 +1 @@ +#define TEST_DATA_PATH "@abs_srcdir@/../testdata" diff --git a/src/lib/config/module_spec_unittests.cc b/src/lib/config/unittests/module_spec_unittests.cc similarity index 99% rename from src/lib/config/module_spec_unittests.cc rename to src/lib/config/unittests/module_spec_unittests.cc index 23d9d1d6f6..39c829360a 100644 --- a/src/lib/config/module_spec_unittests.cc +++ b/src/lib/config/unittests/module_spec_unittests.cc @@ -16,7 +16,7 @@ #include -#include +#include #include diff --git a/src/lib/config/run_unittests.cc b/src/lib/config/unittests/run_unittests.cc similarity index 100% rename from src/lib/config/run_unittests.cc rename to src/lib/config/unittests/run_unittests.cc