diff options
Diffstat (limited to '')
-rw-r--r-- | src/bin/d2/tests/Makefile.am | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/src/bin/d2/tests/Makefile.am b/src/bin/d2/tests/Makefile.am new file mode 100644 index 0000000..5491584 --- /dev/null +++ b/src/bin/d2/tests/Makefile.am @@ -0,0 +1,131 @@ +SUBDIRS = . + +# Add to the tarball: +EXTRA_DIST = +EXTRA_DIST += testdata/d2_cfg_tests.json +EXTRA_DIST += testdata/get_config.json + +TESTS_ENVIRONMENT = $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND) + +# Shell tests +SHTESTS = d2_process_tests.sh + +# As with every file generated by ./configure, clean them up when running +# "make distclean", but not on "make clean". +DISTCLEANFILES = $(SHTESTS) +DISTCLEANFILES += d2_process_tests.sh +DISTCLEANFILES += test_data_files_config.h +DISTCLEANFILES += test_callout_libraries.h +DISTCLEANFILES += test_configured_libraries.h + +if HAVE_GTEST + +# C++ tests +PROGRAM_TESTS = d2_unittests + +AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib +AM_CPPFLAGS += -I$(top_srcdir)/src/bin -I$(top_builddir)/src/bin +AM_CPPFLAGS += $(BOOST_INCLUDES) +AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/bin/d2/tests\" +AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\" +AM_CPPFLAGS += -DCFG_EXAMPLES=\"$(abs_top_srcdir)/doc/examples/ddns\" +AM_CPPFLAGS += -DSYNTAX_FILE=\"$(abs_srcdir)/../d2_parser.yy\" + +AM_CXXFLAGS = $(KEA_CXXFLAGS) + +if USE_STATIC_LINK +AM_LDFLAGS = -static +endif + +d2_unittests_SOURCES = d2_unittests.cc +d2_unittests_SOURCES += d2_process_unittests.cc +d2_unittests_SOURCES += d2_cfg_mgr_unittests.cc +d2_unittests_SOURCES += d2_queue_mgr_unittests.cc +d2_unittests_SOURCES += d2_update_mgr_unittests.cc +d2_unittests_SOURCES += nc_add_unittests.cc +d2_unittests_SOURCES += nc_remove_unittests.cc +d2_unittests_SOURCES += d2_controller_unittests.cc +d2_unittests_SOURCES += d2_simple_parser_unittest.cc +d2_unittests_SOURCES += parser_unittest.cc parser_unittest.h +d2_unittests_SOURCES += get_config_unittest.cc +d2_unittests_SOURCES += d2_command_unittest.cc +d2_unittests_SOURCES += simple_add_unittests.cc +d2_unittests_SOURCES += simple_remove_unittests.cc + +d2_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) +d2_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS) +if HAVE_MYSQL +d2_unittests_LDFLAGS += $(MYSQL_LIBS) +endif +if HAVE_PGSQL +d2_unittests_LDFLAGS += $(PGSQL_LIBS) +endif +d2_unittests_LDFLAGS += $(GTEST_LDFLAGS) + +d2_unittests_LDADD = $(top_builddir)/src/bin/d2/libd2.la +d2_unittests_LDADD += $(top_builddir)/src/lib/d2srv/testutils/libd2srvtest.la +d2_unittests_LDADD += $(top_builddir)/src/lib/d2srv/libkea-d2srv.la +d2_unittests_LDADD += $(top_builddir)/src/lib/process/testutils/libprocesstest.la +d2_unittests_LDADD += $(top_builddir)/src/lib/process/libkea-process.la +d2_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la +d2_unittests_LDADD += $(top_builddir)/src/lib/asiodns/libkea-asiodns.la +d2_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la +d2_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la +d2_unittests_LDADD += $(top_builddir)/src/lib/http/libkea-http.la +d2_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la +d2_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la +d2_unittests_LDADD += $(top_builddir)/src/lib/database/libkea-database.la +d2_unittests_LDADD += $(top_builddir)/src/lib/testutils/libkea-testutils.la +d2_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la +d2_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la +d2_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la +d2_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la +d2_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la +d2_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la +d2_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la +d2_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS) +d2_unittests_LDADD += $(BOOST_LIBS) $(GTEST_LDADD) + +# The basic callout library - contains standard callouts +libcallout_la_SOURCES = callout_library.cc +libcallout_la_CXXFLAGS = $(AM_CXXFLAGS) +libcallout_la_CPPFLAGS = $(AM_CPPFLAGS) +libcallout_la_LIBADD = $(top_builddir)/src/lib/exceptions/libkea-exceptions.la +libcallout_la_LIBADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la +libcallout_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la +libcallout_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere + +# The d2_srv_configured callout library +libconfigured_la_SOURCES = configured_library.cc +libconfigured_la_CXXFLAGS = $(AM_CXXFLAGS) +libconfigured_la_CPPFLAGS = $(AM_CPPFLAGS) +libconfigured_la_LIBADD = $(top_builddir)/src/lib/hooks/libkea-hooks.la +libconfigured_la_LIBADD += $(top_builddir)/src/lib/cc/libkea-cc.la +libconfigured_la_LIBADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la +libconfigured_la_LIBADD += $(top_builddir)/src/lib/log/libkea-log.la +libconfigured_la_LIBADD += $(top_builddir)/src/lib/util/libkea-util.la +libconfigured_la_LIBADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la +libconfigured_la_LIBADD += $(LOG4CPLUS_LIBS) $(BOOST_LIBS) +libconfigured_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere + +noinst_LTLIBRARIES = libcallout.la libconfigured.la + +nodist_d2_unittests_SOURCES = +nodist_d2_unittests_SOURCES += test_data_files_config.h +nodist_d2_unittests_SOURCES += test_callout_libraries.h +nodist_d2_unittests_SOURCES += test_configured_libraries.h + +# Run C++ tests on "make check". +TESTS = $(PROGRAM_TESTS) + +# Run shell tests on "make check". +check_SCRIPTS = $(SHTESTS) +TESTS += $(SHTESTS) + +# Don't install C++ tests. +noinst_PROGRAMS = $(PROGRAM_TESTS) + +endif + +# Don't install shell tests. +noinst_SCRIPTS = $(SHTESTS) |