Makefile.am 4.06 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_CPPFLAGS += -DTOP_SRCDIR=\"${abs_top_srcdir}\"
6
AM_CXXFLAGS = $(B10_CXXFLAGS)
7 8
AM_LDADD    =
AM_LDFLAGS  =
9 10

if USE_STATIC_LINK
11
AM_LDFLAGS += -static
12 13 14 15
endif

CLEANFILES = *.gcno *.gcda

16 17 18 19
noinst_PROGRAMS = logger_example
logger_example_SOURCES = logger_example.cc
logger_example_CPPFLAGS = $(AM_CPPFLAGS)
logger_example_LDFLAGS = $(AM_LDFLAGS)
Jelte Jansen's avatar
Jelte Jansen committed
20
logger_example_LDADD  = $(top_builddir)/src/lib/log/liblog.la
21 22
logger_example_LDADD += $(top_builddir)/src/lib/util/libutil.la
logger_example_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
Jelte Jansen's avatar
Jelte Jansen committed
23
logger_example_LDADD += $(AM_LDADD) $(LOG4CPLUS_LIBS)
24 25 26 27 28

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)
Jelte Jansen's avatar
Jelte Jansen committed
29
init_logger_test_LDADD  = $(top_builddir)/src/lib/log/liblog.la
30 31
init_logger_test_LDADD += $(top_builddir)/src/lib/util/libutil.la
init_logger_test_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
Jelte Jansen's avatar
Jelte Jansen committed
32
init_logger_test_LDADD += $(AM_LDADD) $(LOG4CPLUS_LIBS)
33

34
if HAVE_GTEST
35
TESTS =
36 37 38 39

# Define the flags used in each set of tests
if USE_CLANGPP
# Workaround unused variables tcout and tcerr in log4cplus's streams.h.
40
AM_CXXFLAGS += -Wno-unused-variable
41
endif
42 43
AM_CPPFLAGS += $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
AM_LDFLAGS  += $(GTEST_LDFLAGS)
44

45 46 47 48 49
AM_LDADD += $(top_builddir)/src/lib/log/liblog.la
AM_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
AM_LDADD += $(top_builddir)/src/lib/util/libutil.la
AM_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
AM_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
50
AM_LDADD += $(GTEST_LDADD)
51 52

# Set of unit tests for the general logging classes
53
TESTS += run_unittests
54 55
run_unittests_SOURCES  = run_unittests.cc
run_unittests_SOURCES += log_formatter_unittest.cc
56
run_unittests_SOURCES += logger_level_impl_unittest.cc
57
run_unittests_SOURCES += logger_level_unittest.cc
Stephen Morris's avatar
Stephen Morris committed
58
run_unittests_SOURCES += logger_manager_unittest.cc
59
run_unittests_SOURCES += logger_name_unittest.cc
60
run_unittests_SOURCES += logger_support_unittest.cc
61
run_unittests_SOURCES += logger_unittest.cc
62
run_unittests_SOURCES += logger_specification_unittest.cc
63 64 65
run_unittests_SOURCES += message_dictionary_unittest.cc
run_unittests_SOURCES += message_reader_unittest.cc
run_unittests_SOURCES += output_option_unittest.cc
66

67 68 69 70
run_unittests_CPPFLAGS = $(AM_CPPFLAGS)
run_unittests_CXXFLAGS = $(AM_CXXFLAGS)
run_unittests_LDADD    = $(AM_LDADD)
run_unittests_LDFLAGS  = $(AM_LDFLAGS)
71 72 73 74 75 76 77 78 79 80

# 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

81 82 83 84
initializer_unittests_1_CPPFLAGS = $(AM_CPPFLAGS)
initializer_unittests_1_CXXFLAGS = $(AM_CXXFLAGS)
initializer_unittests_1_LDADD    = $(AM_LDADD)
initializer_unittests_1_LDFLAGS  = $(AM_LDFLAGS)
85 86 87 88 89

TESTS += initializer_unittests_2
initializer_unittests_2_SOURCES  = run_initializer_unittests.cc
initializer_unittests_2_SOURCES += message_initializer_2_unittest.cc

90 91 92 93
initializer_unittests_2_CPPFLAGS = $(AM_CPPFLAGS)
initializer_unittests_2_CXXFLAGS = $(AM_CXXFLAGS)
initializer_unittests_2_LDADD    = $(AM_LDADD)
initializer_unittests_2_LDFLAGS  = $(AM_LDFLAGS)
94

95
noinst_PROGRAMS += $(TESTS)
96
endif
97

98 99 100 101 102
# 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).

103
check-local:
104
	$(SHELL) $(abs_builddir)/console_test.sh
105
	$(SHELL) $(abs_builddir)/destination_test.sh
106
	$(SHELL) $(abs_builddir)/init_logger_test.sh
107 108
	$(SHELL) $(abs_builddir)/local_file_test.sh
	$(SHELL) $(abs_builddir)/severity_test.sh