Makefile.am 4.3 KB
Newer Older
1
2
PYCOVERAGE_RUN = @PYCOVERAGE_RUN@

3
PYTESTS = d2_test.py
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
EXTRA_DIST = $(PYTESTS)

# Explicitly specify paths to dynamic libraries required by loadable python
# modules. That is required on Mac OS systems. Otherwise we will get exception
# about python not being able to load liblog library.
LIBRARY_PATH_PLACEHOLDER =
if SET_ENV_LIBRARY_PATH
LIBRARY_PATH_PLACEHOLDER += $(ENV_LIBRARY_PATH)=$(abs_top_builddir)/src/lib/cryptolink/.libs:$(abs_top_builddir)/src/lib/dns/.libs:$(abs_top_builddir)/src/lib/dns/python/.libs:$(abs_top_builddir)/src/lib/cc/.libs:$(abs_top_builddir)/src/lib/config/.libs:$(abs_top_builddir)/src/lib/log/.libs:$(abs_top_builddir)/src/lib/util/.libs:$(abs_top_builddir)/src/lib/util/threads/.libs:$(abs_top_builddir)/src/lib/exceptions/.libs:$(abs_top_builddir)/src/lib/util/io/.libs:$(abs_top_builddir)/src/lib/datasrc/.libs:$$$(ENV_LIBRARY_PATH)
endif

# test using command-line arguments, so use check-local target instead of TESTS
check-local:
	for pytest in $(PYTESTS) ; do \
	echo Running test: $$pytest ; \
	PYTHONPATH=$(COMMON_PYTHON_PATH):$(abs_top_srcdir)/src/bin:$(abs_top_builddir)/src/bin/bind10:$(abs_top_builddir)/src/lib/util/io/.libs \
	B10_LOCKFILE_DIR_FROM_BUILD=$(abs_top_builddir) \
	$(LIBRARY_PATH_PLACEHOLDER) \
		$(PYCOVERAGE_RUN) $(abs_srcdir)/$$pytest || exit ; \
	done

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\"
31
AM_CPPFLAGS += -DTEST_DATA_BUILDDIR=\"$(abs_top_builddir)/src/bin/d2/tests\"
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
AM_CPPFLAGS += -DINSTALL_PROG=\"$(abs_top_srcdir)/install-sh\"

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

AM_CXXFLAGS = $(B10_CXXFLAGS)
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

52
TESTS += d2_unittests
53

54
d2_unittests_SOURCES = ../d2_log.h ../d2_log.cc
55
56
57
58
d2_unittests_SOURCES += ../d_process.h
d2_unittests_SOURCES += ../d_controller.cc ../d2_controller.h
d2_unittests_SOURCES += ../d2_process.cc ../d2_process.h
d2_unittests_SOURCES += ../d2_controller.cc ../d2_controller.h
59
d2_unittests_SOURCES += ../d_cfg_mgr.cc ../d_cfg_mgr.h
60
d2_unittests_SOURCES += ../d2_config.cc ../d2_config.h
61
d2_unittests_SOURCES += ../d2_cfg_mgr.cc ../d2_cfg_mgr.h
62
d2_unittests_SOURCES += ../d2_update_message.cc ../d2_update_message.h
63
d2_unittests_SOURCES += ../d2_zone.cc ../d2_zone.h
64
d2_unittests_SOURCES += ../dns_client.cc ../dns_client.h
65
d2_unittests_SOURCES += ../ncr_msg.cc ../ncr_msg.h
66
d2_unittests_SOURCES += d_test_stubs.cc d_test_stubs.h
67
d2_unittests_SOURCES += d2_unittests.cc
68
69
70
d2_unittests_SOURCES += d2_process_unittests.cc
d2_unittests_SOURCES += d_controller_unittests.cc
d2_unittests_SOURCES += d2_controller_unittests.cc
71
d2_unittests_SOURCES += d_cfg_mgr_unittests.cc
72
d2_unittests_SOURCES += d2_cfg_mgr_unittests.cc
73
d2_unittests_SOURCES += d2_update_message_unittests.cc
74
d2_unittests_SOURCES += d2_zone_unittests.cc
75
d2_unittests_SOURCES += dns_client_unittests.cc
76
d2_unittests_SOURCES += ncr_unittests.cc
77
nodist_d2_unittests_SOURCES = ../d2_messages.h ../d2_messages.cc
78

79
80
81
82
83
d2_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
d2_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
d2_unittests_LDADD = $(GTEST_LDADD)
d2_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libb10-exceptions.la
d2_unittests_LDADD += $(top_builddir)/src/lib/log/libb10-log.la
84
d2_unittests_LDADD += $(top_builddir)/src/lib/asiodns/libb10-asiodns.la
85
86
87
d2_unittests_LDADD += $(top_builddir)/src/lib/asiolink/libb10-asiolink.la
d2_unittests_LDADD += $(top_builddir)/src/lib/cc/libb10-cc.la
d2_unittests_LDADD += $(top_builddir)/src/lib/config/libb10-cfgclient.la
88
d2_unittests_LDADD += $(top_builddir)/src/lib/dhcpsrv/libb10-dhcpsrv.la
89
d2_unittests_LDADD += $(top_builddir)/src/lib/dns/libb10-dns++.la
90
d2_unittests_LDADD += $(top_builddir)/src/lib/util/libb10-util.la
91
d2_unittests_LDADD += $(top_builddir)/src/lib/hooks/libb10-hooks.la
92

93
94
95
endif

noinst_PROGRAMS = $(TESTS)