Makefile.am 5.96 KB
Newer Older
1 2 3
SHTESTS =
# The test of dynamic reconfiguration based on signals will work only
# if we are using file based configuration approach.
4
SHTESTS += dhcp6_process_tests.sh
5

6 7
noinst_SCRIPTS = dhcp6_process_tests.sh

8
EXTRA_DIST = $(SHTESTS) dhcp6_process_tests.sh.in
9

10 11
# test using command-line arguments, so use check-local target instead of TESTS
check-local:
12 13
	for shtest in $(SHTESTS) ; do \
	echo Running test: $$shtest ; \
14
	export KEA_LOCKFILE_DIR=$(abs_top_builddir); \
15
	export KEA_PIDFILE_DIR=$(abs_top_builddir); \
16
	${SHELL} $(abs_builddir)/$$shtest || exit ; \
17 18
	done

19 20 21
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
22
AM_CPPFLAGS += -I$(top_srcdir)/src -I$(top_builddir)/src
23
AM_CPPFLAGS += -DTOP_BUILDDIR="\"$(top_builddir)\""
24
AM_CPPFLAGS += $(BOOST_INCLUDES)
25
AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/bin/dhcp6/tests\"
26 27
AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"

28
CLEANFILES  = $(builddir)/logger_lockfile
29
CLEANFILES += $(builddir)/load_marker.txt $(builddir)/unload_marker.txt
30
CLEANFILES += $(builddir)/test_leases.csv.*
31
CLEANFILES += *.json *.log
32

33 34
DISTCLEANFILES = dhcp6_process_tests.sh

35
AM_CXXFLAGS = $(KEA_CXXFLAGS)
36 37 38 39
if USE_CLANGPP
# Disable unused parameter warning caused by some Boost headers when compiling with clang
AM_CXXFLAGS += -Wno-unused-parameter
endif
40

41 42 43 44
if USE_STATIC_LINK
AM_LDFLAGS = -static
endif

45
TESTS_ENVIRONMENT = \
46
        $(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
47

48 49
TESTS =
if HAVE_GTEST
50 51 52 53 54 55 56 57 58 59 60 61 62
# Build shared libraries for testing. The libtool way to create a shared library
# is to specify "-avoid-version -export-dynamic -module" in the library LDFLAGS
# (see http://www.gnu.org/software/libtool/manual/html_node/Link-mode.html).
# Use of these switches will guarantee that the .so files are created in the
# .libs folder and they can be dlopened.
# Note that the shared libraries with callouts should not be used together with
# the --enable-static-link option. With this option, the bind10 libraries are
# statically linked with the program and if the callout invokes the methods
# which belong to these libraries, the library with the callout will get its
# own copy of the static objects (e.g. logger, ServerHooks) and that will lead
# to unexpected errors. For this reason, the --enable-static-link option is
# ignored for unit tests built here.

63 64 65 66
noinst_LTLIBRARIES = libco1.la libco2.la

# -rpath /nowhere is a hack to trigger libtool to not create a
# convenience archive, resulting in shared modules
67

68 69 70
libco1_la_SOURCES  = callout_library_1.cc callout_library_common.h
libco1_la_CXXFLAGS = $(AM_CXXFLAGS)
libco1_la_CPPFLAGS = $(AM_CPPFLAGS)
71
libco1_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere
72 73 74 75

libco2_la_SOURCES  = callout_library_2.cc callout_library_common.h
libco2_la_CXXFLAGS = $(AM_CXXFLAGS)
libco2_la_CPPFLAGS = $(AM_CPPFLAGS)
76
libco2_la_LDFLAGS = -avoid-version -export-dynamic -module -rpath /nowhere
77

78
TESTS += dhcp6_unittests
79
dhcp6_unittests_SOURCES  = dhcp6_unittests.cc
80
dhcp6_unittests_SOURCES += dhcp6_srv_unittest.cc
81
dhcp6_unittests_SOURCES += fqdn_unittest.cc
82
dhcp6_unittests_SOURCES += hooks_unittest.cc
83
dhcp6_unittests_SOURCES += host_unittest.cc
84
dhcp6_unittests_SOURCES += dhcp6_test_utils.cc dhcp6_test_utils.h
85
dhcp6_unittests_SOURCES += d2_unittest.cc d2_unittest.h
86
dhcp6_unittests_SOURCES += marker_file.cc
Tomek Mrugalski's avatar
Tomek Mrugalski committed
87
dhcp6_unittests_SOURCES += ctrl_dhcp6_srv_unittest.cc
88 89
dhcp6_unittests_SOURCES += dhcp6_client.cc dhcp6_client.h
dhcp6_unittests_SOURCES += rebind_unittest.cc
90
dhcp6_unittests_SOURCES += renew_unittest.cc
91
dhcp6_unittests_SOURCES += sarr_unittest.cc
Tomek Mrugalski's avatar
Tomek Mrugalski committed
92
dhcp6_unittests_SOURCES += config_parser_unittest.cc
93
dhcp6_unittests_SOURCES += confirm_unittest.cc
94
dhcp6_unittests_SOURCES += infrequest_unittest.cc
95
dhcp6_unittests_SOURCES += decline_unittest.cc
96
dhcp6_unittests_SOURCES += dhcp6_message_test.cc dhcp6_message_test.h
Tomek Mrugalski's avatar
Tomek Mrugalski committed
97
dhcp6_unittests_SOURCES += kea_controller_unittest.cc
98
dhcp6_unittests_SOURCES += dhcp6to4_ipc_unittest.cc
99

Francis Dupont's avatar
Francis Dupont committed
100
nodist_dhcp6_unittests_SOURCES  = marker_file.h test_libraries.h
101 102

dhcp6_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
103 104 105 106 107 108 109
dhcp6_unittests_LDFLAGS = $(AM_LDFLAGS) $(CRYPTO_LDFLAGS)
if HAVE_MYSQL
dhcp6_unittests_LDFLAGS += $(MYSQL_LIBS)
endif
if HAVE_PGSQL
dhcp6_unittests_LDFLAGS += $(PGSQL_LIBS)
endif
110 111 112
if HAVE_DSCSQL
dhcp6_unittests_LDFLAGS += $(DSCSQL_LIBS)
endif
113 114 115 116 117 118
dhcp6_unittests_LDFLAGS += $(GTEST_LDFLAGS)

dhcp6_unittests_LDADD = $(top_builddir)/src/bin/dhcp6/libdhcp6.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/cfgrpt/libcfgrpt.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libkea-dhcpsrv.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/testutils/libdhcpsrvtest.la
119
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/eval/libkea-eval.la
120 121 122
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/dhcp_ddns/libkea-dhcp_ddns.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/testutils/libkea-testutils.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/stats/libkea-stats.la
123 124
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/config/libkea-cfgclient.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/dhcp/libkea-dhcp++.la
125
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/dhcp/tests/libdhcptest.la
126 127 128 129
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/cc/libkea-cc.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/dns/libkea-dns++.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/cryptolink/libkea-cryptolink.la
130 131
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/hooks/libkea-hooks.la
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
132
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
133
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
134
dhcp6_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
135
dhcp6_unittests_LDADD += $(LOG4CPLUS_LIBS) $(CRYPTO_LIBS)
136
dhcp6_unittests_LDADD += $(BOOST_LIBS) $(GTEST_LDADD)
137 138 139
endif

noinst_PROGRAMS = $(TESTS)