blob: e510230c460b091ab1d68c975dac275711c3d38e [file] [log] [blame]
Vernon Maueryebe8e902018-12-12 09:39:22 -08001COMMON_CXX = \
2 -flto \
3 -Wno-psabi \
4 $(SDBUSPLUS_CFLAGS) \
5 $(SYSTEMD_CFLAGS) \
6 $(libmapper_CFLAGS) \
7 $(SDBUSPLUS_CFLAGS) \
8 $(PHOSPHOR_LOGGING_CFLAGS) \
9 $(PHOSPHOR_DBUS_INTERFACES_CFLAGS) \
10 -DBOOST_ERROR_CODE_HEADER_ONLY \
11 -DBOOST_SYSTEM_NO_DEPRECATED \
12 -DBOOST_COROUTINES_NO_DEPRECATION_WARNING \
13 -DBOOST_ASIO_DISABLE_THREADS \
14 -DBOOST_ALL_NO_LIB
15
16AM_CPPFLAGS = \
17 -I$(top_srcdir) \
18 -I$(top_srcdir)/include \
19 $(CODE_COVERAGE_CPPFLAGS) \
20 $(GTEST_CFLAGS)
Emily Shafferc07e72c2018-06-18 10:37:31 -070021AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
Peter Hanson4a589852017-06-07 17:40:45 -070022AM_CXXFLAGS = $(GTEST_MAIN_CFLAGS) $(GTEST_CFLAGS)
23AM_LDFLAGS = $(GTEST_MAIN_LIBS) $(OESDK_TESTCASE_FLAGS)
Matthew Barth00b1e5b2016-09-09 12:15:46 -050024
25# Run all 'check' test programs
Peter Hanson4a589852017-06-07 17:40:45 -070026check_PROGRAMS =
Matthew Barth00b1e5b2016-09-09 12:15:46 -050027TESTS = $(check_PROGRAMS)
28
29# Build/add sample_unittest to test suite
Patrick Williamsc0c19672016-11-04 17:37:27 -050030sample_unittest_CPPFLAGS = -Igtest $(GTEST_CPPFLAGS) $(AM_CPPFLAGS)
Emily Shafferc07e72c2018-06-18 10:37:31 -070031sample_unittest_CXXFLAGS = $(PTHREAD_CFLAGS) $(CODE_COVERAGE_CXXFLAGS) \
32 $(CODE_COVERAGE_CFLAGS)
Vernon Maueryebe8e902018-12-12 09:39:22 -080033sample_unittest_LDFLAGS = -lgtest_main -lgtest -pthread $(OESDK_TESTCASE_FLAGS) \
Emily Shafferc07e72c2018-06-18 10:37:31 -070034 $(CODE_COVERAGE_LDFLAGS)
35sample_unittest_SOURCES = %reldir%/sample_unittest.cpp
Matthew Barth00b1e5b2016-09-09 12:15:46 -050036sample_unittest_LDADD = $(top_builddir)/sample.o
Emily Shafferc07e72c2018-06-18 10:37:31 -070037check_PROGRAMS += %reldir%/sample_unittest
Peter Hanson4a589852017-06-07 17:40:45 -070038
39# Build/add oemrouter_unittest to test suite
Patrick Venture79c7c852018-07-25 13:10:25 -070040# Issue #3325
41#check_PROGRAMS += oemrouter_unittest
42#oemrouter_unittest_SOURCES = oemrouter_unittest.cpp
43#oemrouter_unittest_LDADD = $(top_builddir)/oemrouter.o
Vernon Maueryebe8e902018-12-12 09:39:22 -080044
45# Build/add message packing/unpacking unit tests
46message_unittest_CPPFLAGS = \
47 -Igtest \
48 $(GTEST_CPPFLAGS) \
49 $(AM_CPPFLAGS)
50message_unittest_CXXFLAGS = \
51 $(COMMON_CXX) \
52 $(PTHREAD_CFLAGS) \
53 $(PHOSPHOR_LOGGING_CFLAGS) \
54 $(CODE_COVERAGE_CXXFLAGS) \
55 $(CODE_COVERAGE_CFLAGS)
56message_unittest_LDFLAGS = \
57 -lgtest_main \
58 -lgtest \
59 -lsdbusplus \
60 -lsystemd \
61 -pthread \
62 $(PHOSPHOR_LOGGING_LIBS) \
63 $(OESDK_TESTCASE_FLAGS) \
64 $(CODE_COVERAGE_LDFLAGS)
65message_unittest_SOURCES = \
66 %reldir%/message/payload.cpp \
67 %reldir%/message/unpack.cpp \
68 %reldir%/message/pack.cpp
69check_PROGRAMS += %reldir%/message_unittest