summaryrefslogtreecommitdiffstats
path: root/src/bin/d2/tests/Makefile.am
blob: 5491584f62a57c6ccb6f2e613e467a84d3b164bb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
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)