Makefile.am 2.96 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 6 7 8 9 10 11 12 13 14 15
AM_CXXFLAGS = $(B10_CXXFLAGS)

if USE_STATIC_LINK
AM_LDFLAGS = -static
endif

CLEANFILES = *.gcno *.gcda

TESTS =
if HAVE_GTEST
TESTS += run_unittests
16 17
run_unittests_SOURCES  = run_unittests.cc
run_unittests_SOURCES += log_formatter_unittest.cc
18
run_unittests_SOURCES += logger_level_impl_unittest.cc
19
run_unittests_SOURCES += logger_level_unittest.cc
Stephen Morris's avatar
Stephen Morris committed
20
run_unittests_SOURCES += logger_manager_unittest.cc
21
run_unittests_SOURCES += logger_name_unittest.cc
22
run_unittests_SOURCES += logger_support_unittest.cc
23
run_unittests_SOURCES += logger_unittest.cc
24
run_unittests_SOURCES += logger_specification_unittest.cc
25 26 27 28 29
run_unittests_SOURCES += message_dictionary_unittest.cc
run_unittests_SOURCES += message_initializer_unittest_2.cc
run_unittests_SOURCES += message_initializer_unittest.cc
run_unittests_SOURCES += message_reader_unittest.cc
run_unittests_SOURCES += output_option_unittest.cc
30

31 32
run_unittests_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES) $(LOG4CPLUS_INCLUDES)
run_unittests_LDFLAGS  = $(AM_LDFLAGS)  $(GTEST_LDFLAGS)
33

34 35
run_unittests_CXXFLAGS = $(AM_CXXFLAGS)
if USE_CLANGPP
36 37 38
# This is to workaround unused variables tcout and tcerr in
# log4cplus's streams.h.
run_unittests_CXXFLAGS += -Wno-unused-variable
39
endif
40 41
run_unittests_LDADD  = $(GTEST_LDADD)
run_unittests_LDADD += $(top_builddir)/src/lib/log/liblog.la
Jelte Jansen's avatar
Jelte Jansen committed
42
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
43
run_unittests_LDADD += $(top_builddir)/src/lib/util/libutil.la
Stephen Morris's avatar
Stephen Morris committed
44
run_unittests_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
45
run_unittests_LDADD += $(top_builddir)/src/lib/util/unittests/libutil_unittests.la
46 47
endif

48
check_PROGRAMS = logger_example
49 50 51 52 53
logger_example_SOURCES = logger_example.cc
logger_example_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
logger_example_LDFLAGS = $(AM_LDFLAGS) $(LOG4CPLUS_LDFLAGS)
logger_example_LDADD  = $(top_builddir)/src/lib/log/liblog.la
logger_example_LDADD += $(top_builddir)/src/lib/util/libutil.la
54
logger_example_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
55

56 57 58 59 60 61
check_PROGRAMS += init_logger_test
init_logger_test_SOURCES = init_logger_test.cc
init_logger_test_CPPFLAGS = $(AM_CPPFLAGS) $(GTEST_INCLUDES)
init_logger_test_LDFLAGS = $(AM_LDFLAGS) $(LOG4CPLUS_LDFLAGS)
init_logger_test_LDADD  = $(top_builddir)/src/lib/log/liblog.la
init_logger_test_LDADD += $(top_builddir)/src/lib/util/libutil.la
62
init_logger_test_LDADD += $(top_builddir)/src/lib/exceptions/libexceptions.la
63

64
check_PROGRAMS += $(TESTS)
65

66 67 68 69 70
# 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).

71
check-local:
72
	$(SHELL) $(abs_builddir)/console_test.sh
73
	$(SHELL) $(abs_builddir)/destination_test.sh
74
	$(SHELL) $(abs_builddir)/init_logger_test.sh
75 76
	$(SHELL) $(abs_builddir)/local_file_test.sh
	$(SHELL) $(abs_builddir)/severity_test.sh