Makefile.am 4.9 KB
Newer Older
1 2
AUTOMAKE_OPTIONS = subdir-objects

3 4 5 6
SHTESTS =
# The test of dynamic reconfiguration based on signals will work only
# if we are using file based configuration approach.
if CONFIG_BACKEND_JSON
7
SHTESTS += d2_process_tests.sh
8 9
endif

10 11
noinst_SCRIPTS = d2_process_tests.sh

12
EXTRA_DIST  = d2_process_tests.sh.in
13
EXTRA_DIST += testdata/d2_cfg_tests.json
14 15 16

# test using command-line arguments, so use check-local target instead of TESTS
check-local:
17 18
	for shtest in $(SHTESTS) ; do \
	echo Running test: $$shtest ; \
19
	export KEA_LOCKFILE_DIR=$(abs_top_builddir); \
20
	${SHELL} $(abs_builddir)/$$shtest || exit ; \
21 22
	done

23 24 25 26 27 28 29
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
AM_CPPFLAGS += -I$(top_builddir)/src/bin # for generated spec_config.h header
AM_CPPFLAGS += -I$(top_srcdir)/src/bin
AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
AM_CPPFLAGS += -I$(top_srcdir)/src/lib/asiolink
AM_CPPFLAGS += $(BOOST_INCLUDES)
AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(abs_top_srcdir)/src/lib/testutils/testdata\"
30
AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/bin/d2/tests\"
31 32 33 34
AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"

CLEANFILES = $(builddir)/interfaces.txt $(builddir)/logger_lockfile

35 36
DISTCLEANFILES = d2_process_tests.sh

37
AM_CXXFLAGS = $(KEA_CXXFLAGS)
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
if USE_CLANGPP
# Disable unused parameter warning caused by some Boost headers when compiling with clang
AM_CXXFLAGS += -Wno-unused-parameter
endif

if USE_STATIC_LINK
AM_LDFLAGS = -static
endif

TESTS_ENVIRONMENT = \
        $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)

TESTS =
if HAVE_GTEST

53
TESTS += d2_unittests
54

55 56
d2_unittests_SOURCES = ../d2_asio.h
d2_unittests_SOURCES += ../d2_log.h ../d2_log.cc
57
d2_unittests_SOURCES += ../d_process.h
58
d2_unittests_SOURCES += ../d_controller.cc ../d_controller.h
59
d2_unittests_SOURCES += ../d_cfg_mgr.cc ../d_cfg_mgr.h
60
d2_unittests_SOURCES += ../d2_process.cc ../d2_process.h
61
d2_unittests_SOURCES += ../d2_config.cc ../d2_config.h
62
d2_unittests_SOURCES += ../d2_cfg_mgr.cc ../d2_cfg_mgr.h
63
d2_unittests_SOURCES += ../d2_queue_mgr.cc ../d2_queue_mgr.h
64
d2_unittests_SOURCES += ../d2_update_message.cc ../d2_update_message.h
65
d2_unittests_SOURCES += ../d2_update_mgr.cc ../d2_update_mgr.h
66
d2_unittests_SOURCES += ../d2_zone.cc ../d2_zone.h
67
d2_unittests_SOURCES += ../dns_client.cc ../dns_client.h
68
d2_unittests_SOURCES += ../io_service_signal.cc ../io_service_signal.h
69
d2_unittests_SOURCES += ../labeled_value.cc ../labeled_value.h
70
d2_unittests_SOURCES += ../nc_add.cc ../nc_add.h
71
d2_unittests_SOURCES += ../nc_remove.cc ../nc_remove.h
72
d2_unittests_SOURCES += ../nc_trans.cc ../nc_trans.h
73
d2_unittests_SOURCES += ../state_model.cc ../state_model.h
74
d2_unittests_SOURCES += d_test_stubs.cc d_test_stubs.h
75
d2_unittests_SOURCES += d2_unittests.cc
76
d2_unittests_SOURCES += d2_process_unittests.cc
77
d2_unittests_SOURCES += d_cfg_mgr_unittests.cc
78
d2_unittests_SOURCES += d2_cfg_mgr_unittests.cc
79
d2_unittests_SOURCES += d2_queue_mgr_unittests.cc
80
d2_unittests_SOURCES += d2_update_message_unittests.cc
81
d2_unittests_SOURCES += d2_update_mgr_unittests.cc
82
d2_unittests_SOURCES += d2_zone_unittests.cc
83
d2_unittests_SOURCES += dns_client_unittests.cc
84
d2_unittests_SOURCES += io_service_signal_unittests.cc
85
d2_unittests_SOURCES += labeled_value_unittests.cc
86
d2_unittests_SOURCES += nc_add_unittests.cc
87
d2_unittests_SOURCES += nc_remove_unittests.cc
88
d2_unittests_SOURCES += nc_test_utils.cc nc_test_utils.h
89
d2_unittests_SOURCES += nc_trans_unittests.cc
90
d2_unittests_SOURCES += state_model_unittests.cc
91
nodist_d2_unittests_SOURCES = ../d2_messages.h ../d2_messages.cc
92

93 94 95 96 97 98 99 100 101 102 103
if CONFIG_BACKEND_BUNDY
d2_unittests_SOURCES += ../bundy_d2_controller.cc ../bundy_d2_controller.h
d2_unittests_SOURCES += bundy_d2_controller_unittests.cc
else
if CONFIG_BACKEND_JSON
d2_unittests_SOURCES += ../d2_controller.cc ../d2_controller.h
d2_unittests_SOURCES += d2_controller_unittests.cc
d2_unittests_SOURCES += d_controller_unittests.cc
endif
endif

104 105 106
d2_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
d2_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
d2_unittests_LDADD = $(GTEST_LDADD)
107 108 109 110 111 112 113 114 115
d2_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
d2_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
d2_unittests_LDADD += $(top_builddir)/src/lib/asiodns/libkea-asiodns.la
d2_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
d2_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
d2_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
d2_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
d2_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
d2_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
116
d2_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
117 118 119
d2_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
d2_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
d2_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
120

121 122 123
endif

noinst_PROGRAMS = $(TESTS)