Makefile.am 5.78 KB
Newer Older
1
2
3
SUBDIRS = .

AM_CPPFLAGS = -I$(top_builddir)/src/lib -I$(top_srcdir)/src/lib
4
AM_CPPFLAGS += $(BOOST_INCLUDES)
5
AM_CXXFLAGS = $(KEA_CXXFLAGS)
6
7
AM_LDADD    =
AM_LDFLAGS  =
8
9

if USE_STATIC_LINK
10
AM_LDFLAGS += -static
11
12
endif

13
CLEANFILES = *.gcno *.gcda *.lock
14

15
EXTRA_DIST = log_test_messages.mes
16
BUILT_SOURCES = log_test_messages.h log_test_messages.cc
17
18
19
log_test_messages.h log_test_messages.cc: s-messages

s-messages: log_test_messages.mes
20
	$(AM_V_GEN) $(top_builddir)/src/lib/log/compiler/message $(top_srcdir)/src/lib/log/tests/log_test_messages.mes
21
	touch $@
22

23
CLEANFILES += log_test_messages.h log_test_messages.cc s-messages
24

25
26
27
28
noinst_PROGRAMS = logger_example
logger_example_SOURCES = logger_example.cc
logger_example_CPPFLAGS = $(AM_CPPFLAGS)
logger_example_LDFLAGS = $(AM_LDFLAGS)
29
30
31
logger_example_LDADD  = $(top_builddir)/src/lib/log/libkea-log.la
logger_example_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
logger_example_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
Jelte Jansen's avatar
Jelte Jansen committed
32
logger_example_LDADD += $(AM_LDADD) $(LOG4CPLUS_LIBS)
33
34
35
36
37

noinst_PROGRAMS += init_logger_test
init_logger_test_SOURCES = init_logger_test.cc
init_logger_test_CPPFLAGS = $(AM_CPPFLAGS)
init_logger_test_LDFLAGS = $(AM_LDFLAGS)
38
39
40
init_logger_test_LDADD  = $(top_builddir)/src/lib/log/libkea-log.la
init_logger_test_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
init_logger_test_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
Jelte Jansen's avatar
Jelte Jansen committed
41
init_logger_test_LDADD += $(AM_LDADD) $(LOG4CPLUS_LIBS)
42

43
44
45
46
noinst_PROGRAMS += buffer_logger_test
buffer_logger_test_SOURCES = buffer_logger_test.cc
buffer_logger_test_CPPFLAGS = $(AM_CPPFLAGS)
buffer_logger_test_LDFLAGS = $(AM_LDFLAGS)
47
48
49
buffer_logger_test_LDADD  = $(top_builddir)/src/lib/log/libkea-log.la
buffer_logger_test_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
buffer_logger_test_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
50
51
buffer_logger_test_LDADD += $(AM_LDADD) $(LOG4CPLUS_LIBS)

52
53
# This test directly uses libkea-threads, and on some systems it seems to
# require explicit LDADD (even if libkea-log has indirect dependencies)
54
55
noinst_PROGRAMS += logger_lock_test
logger_lock_test_SOURCES = logger_lock_test.cc
56
nodist_logger_lock_test_SOURCES = log_test_messages.cc log_test_messages.h
57
58
logger_lock_test_CPPFLAGS = $(AM_CPPFLAGS)
logger_lock_test_LDFLAGS = $(AM_LDFLAGS)
59
60
61
62
logger_lock_test_LDADD  = $(top_builddir)/src/lib/log/libkea-log.la
logger_lock_test_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
logger_lock_test_LDADD += $(top_builddir)/src/lib/util/threads/libkea-threads.la
logger_lock_test_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
63
64
logger_lock_test_LDADD += $(AM_LDADD) $(LOG4CPLUS_LIBS)

65
TESTS_ENVIRONMENT = \
66
	$(LIBTOOL) --mode=execute $(VALGRIND_COMMAND)
67

68
if HAVE_GTEST
69
TESTS =
70
71
72
73

# Define the flags used in each set of tests
if USE_CLANGPP
# Workaround unused variables tcout and tcerr in log4cplus's streams.h.
74
AM_CXXFLAGS += -Wno-unused-variable
75
endif
76
77
AM_CPPFLAGS += $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
AM_LDFLAGS  += $(GTEST_LDFLAGS)
78

79
80
AM_LDADD += $(top_builddir)/src/lib/util/libkea-util.la
AM_LDADD += $(top_builddir)/src/lib/log/libkea-log.la
81
AM_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
82
AM_LDADD += $(top_builddir)/src/lib/exceptions/libkea-exceptions.la
83
AM_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
84
AM_LDADD += $(GTEST_LDADD)
85
86

# Set of unit tests for the general logging classes
87
TESTS += run_unittests
88
89
run_unittests_SOURCES  = run_unittests.cc
run_unittests_SOURCES += log_formatter_unittest.cc
90
run_unittests_SOURCES += logger_level_impl_unittest.cc
91
run_unittests_SOURCES += logger_level_unittest.cc
Stephen Morris's avatar
Stephen Morris committed
92
run_unittests_SOURCES += logger_manager_unittest.cc
93
run_unittests_SOURCES += logger_name_unittest.cc
94
run_unittests_SOURCES += logger_support_unittest.cc
95
run_unittests_SOURCES += logger_unittest.cc
96
run_unittests_SOURCES += logger_specification_unittest.cc
97
98
99
run_unittests_SOURCES += message_dictionary_unittest.cc
run_unittests_SOURCES += message_reader_unittest.cc
run_unittests_SOURCES += output_option_unittest.cc
100
run_unittests_SOURCES += buffer_appender_unittest.cc
101
nodist_run_unittests_SOURCES = log_test_messages.cc log_test_messages.h
102

103
104
105
run_unittests_CPPFLAGS = $(AM_CPPFLAGS)
run_unittests_CXXFLAGS = $(AM_CXXFLAGS)
run_unittests_LDADD    = $(AM_LDADD)
106
run_unittests_LDADD    +=  $(LOG4CPLUS_LIBS)
107
run_unittests_LDFLAGS  = $(AM_LDFLAGS)
108
109
110
111
112
113
114
115
116
117

# logging initialization tests.  These are put in separate programs to
# ensure that the initialization status at the start of each test is known,
# and to prevent circumstances where the execution of one test affects the
# starting conditions of the next.
TESTS += initializer_unittests_1
initializer_unittests_1_SOURCES  = run_initializer_unittests.cc
initializer_unittests_1_SOURCES += message_initializer_1_unittest.cc
initializer_unittests_1_SOURCES += message_initializer_1a_unittest.cc

118
119
120
121
initializer_unittests_1_CPPFLAGS = $(AM_CPPFLAGS)
initializer_unittests_1_CXXFLAGS = $(AM_CXXFLAGS)
initializer_unittests_1_LDADD    = $(AM_LDADD)
initializer_unittests_1_LDFLAGS  = $(AM_LDFLAGS)
122

123
noinst_PROGRAMS += $(TESTS)
124
endif
125

126
127
128
129
130
131
132
noinst_SCRIPTS  = console_test.sh
noinst_SCRIPTS += destination_test.sh
noinst_SCRIPTS += init_logger_test.sh
noinst_SCRIPTS += local_file_test.sh
noinst_SCRIPTS += logger_lock_test.sh
noinst_SCRIPTS += severity_test.sh

133
134
135
136
# Additional test using the shell.  These are principally tests
# where the global logging environment is affected, and where the
# output needs to be compared with stored output (where "cut" and
# "diff" are useful utilities).
137
check-local:
138
	$(SHELL) $(abs_builddir)/console_test.sh
139
	$(SHELL) $(abs_builddir)/destination_test.sh
140
	$(SHELL) $(abs_builddir)/init_logger_test.sh
141
	$(SHELL) $(abs_builddir)/buffer_logger_test.sh
142
	$(SHELL) $(abs_builddir)/local_file_test.sh
143
	$(SHELL) $(abs_builddir)/logger_lock_test.sh
144
	$(SHELL) $(abs_builddir)/severity_test.sh