Makefile.am 1.99 KB
Newer Older
1
AM_CPPFLAGS = -I$(top_srcdir)/src/lib -I$(top_builddir)/src/lib
2
AM_CPPFLAGS += $(BOOST_INCLUDES)
3
AM_CPPFLAGS += -I$(top_builddir)/src/lib/util -I$(top_srcdir)/src/util
4 5 6 7 8 9 10 11 12
AM_CPPFLAGS += -I$(top_builddir)/src/lib/cc
AM_CPPFLAGS += -DTEST_DATA_DIR=\"$(srcdir)/testdata\"

AM_CXXFLAGS = $(B10_CXXFLAGS)

if USE_STATIC_LINK
AM_LDFLAGS = -static
endif

13 14 15 16 17 18
# Some versions of GCC warn about some versions of Boost regarding
# missing initializer for members in its posix_time.
# https://svn.boost.org/trac/boost/ticket/3477
# But older GCC compilers don't have the flag.
AM_CXXFLAGS += $(WARNING_NO_MISSING_FIELD_INITIALIZERS_CFLAG)

19 20
CLEANFILES = *.gcno *.gcda

21
TESTS_ENVIRONMENT = \
22
	$(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
23

24 25 26
TESTS =
if HAVE_GTEST
TESTS += run_unittests
Stephen Morris's avatar
Stephen Morris committed
27
run_unittests_SOURCES  = run_unittests.cc
28 29 30
run_unittests_SOURCES += io_address_unittest.cc
run_unittests_SOURCES += io_endpoint_unittest.cc
run_unittests_SOURCES += io_socket_unittest.cc
31
run_unittests_SOURCES += interval_timer_unittest.cc
32 33
run_unittests_SOURCES += tcp_endpoint_unittest.cc
run_unittests_SOURCES += tcp_socket_unittest.cc
34 35
run_unittests_SOURCES += udp_endpoint_unittest.cc
run_unittests_SOURCES += udp_socket_unittest.cc
36
run_unittests_SOURCES += io_service_unittest.cc
37
run_unittests_SOURCES += local_socket_unittest.cc
38
run_unittests_SOURCES += dummy_io_callback_unittest.cc
Stephen Morris's avatar
Stephen Morris committed
39

40
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
Stephen Morris's avatar
Stephen Morris committed
41

42 43
run_unittests_LDADD = $(top_builddir)/src/lib/asiolink/libkea-asiolink.la
run_unittests_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
44
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
45
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
46
run_unittests_LDADD += $(GTEST_LDADD)
Stephen Morris's avatar
Stephen Morris committed
47

48
run_unittests_LDFLAGS = $(AM_LDFLAGS) $(GTEST_LDFLAGS)
Stephen Morris's avatar
Stephen Morris committed
49

50 51 52 53 54 55
# Note: the ordering matters: -Wno-... must follow -Wextra (defined in
# B10_CXXFLAGS)
run_unittests_CXXFLAGS = $(AM_CXXFLAGS)
if USE_GXX
run_unittests_CXXFLAGS += -Wno-unused-parameter
endif
56 57
endif

58
noinst_PROGRAMS = $(TESTS)