blob: 445569aaac69ec2f9e41d2815d6e468a9140dd0a [file] [log] [blame]
William A. Kennington III6c17d3d2018-06-19 18:34:43 -07001@VALGRIND_CHECK_RULES@
Lei YU199b3b12019-09-25 17:58:41 +08002VALGRIND_SUPPRESSIONS_FILES = valgrind.supp
3
William A. Kennington III592128c2018-06-19 18:34:17 -07004
Brad Bishop14275cf2016-11-10 16:24:48 -05005if WANT_LIBSDBUSPLUS
6
William A. Kennington III809e3732018-06-19 18:41:07 -07007AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) \
William A. Kennington IIIc20acf62018-06-22 18:38:03 -07008 $(GTEST_CFLAGS) $(GMOCK_CFLAGS) $(SYSTEMD_CFLAGS) \
9 $(CODE_COVERAGE_CPPFLAGS)
William A. Kennington III592128c2018-06-19 18:34:17 -070010AM_CFLAGS = $(CODE_COVERAGE_CFLAGS)
11AM_CXXFLAGS = $(CODE_COVERAGE_CXXFLAGS)
William A. Kennington III809e3732018-06-19 18:41:07 -070012test_ldadd = $(top_builddir)/libsdbusplus.la $(SYSTEMD_LIBS) \
William A. Kennington III592128c2018-06-19 18:34:17 -070013 $(OESDK_TESTCASE_FLAGS) $(CODE_COVERAGE_LIBS)
Vernon Mauery7efcdae2018-09-06 06:34:39 -070014gtest_ldadd = $(test_ldadd) $(GTEST_LIBS) $(GMOCK_LIBS) -lgmock_main -lpthread
Patrick Williams83a9d0b2016-11-04 17:06:13 -050015
William A. Kennington III809e3732018-06-19 18:41:07 -070016check_PROGRAMS =
Patrick Williams83a9d0b2016-11-04 17:06:13 -050017TESTS = $(check_PROGRAMS)
18
Patrick Williamsb4041d42017-04-27 21:49:00 -050019check_PROGRAMS += bus_list_names
20bus_list_names_SOURCES = bus/list_names.cpp
William A. Kennington III809e3732018-06-19 18:41:07 -070021bus_list_names_LDADD = $(gtest_ldadd)
Patrick Williamsb4041d42017-04-27 21:49:00 -050022
Patrick Williamsfaa89f22017-04-29 15:50:13 -050023check_PROGRAMS += bus_match
24bus_match_SOURCES = bus/match.cpp
William A. Kennington III809e3732018-06-19 18:41:07 -070025bus_match_LDADD = $(gtest_ldadd)
Patrick Williamsfaa89f22017-04-29 15:50:13 -050026
William A. Kennington III874e82e2018-06-22 19:23:54 -070027check_PROGRAMS += exception_sdbus_error
28exception_sdbus_error_SOURCES = exception/sdbus_error.cpp
29exception_sdbus_error_LDADD = $(gtest_ldadd)
30
Patrick Williams83a9d0b2016-11-04 17:06:13 -050031check_PROGRAMS += message_append
Patrick Williams83a9d0b2016-11-04 17:06:13 -050032message_append_SOURCES = message/append.cpp
William A. Kennington IIIa1e9e2a2018-06-23 13:33:25 -070033message_append_LDADD = $(gtest_ldadd)
Patrick Williams83a9d0b2016-11-04 17:06:13 -050034
35check_PROGRAMS += message_read
Patrick Williams83a9d0b2016-11-04 17:06:13 -050036message_read_SOURCES = message/read.cpp
William A. Kennington IIIb4b4fa12018-06-25 17:20:06 -070037message_read_LDADD = $(gtest_ldadd)
Patrick Williams83a9d0b2016-11-04 17:06:13 -050038
Patrick Williams9db28642017-01-06 15:55:05 -060039check_PROGRAMS += message_native_types
40message_native_types_SOURCES = message/native_types.cpp
Patrick Williams43b283a2017-05-01 14:15:54 -050041message_native_types_LDADD = $(gtest_ldadd)
Patrick Williams9db28642017-01-06 15:55:05 -060042
Patrick Williams83a9d0b2016-11-04 17:06:13 -050043check_PROGRAMS += message_types
44message_types_SOURCES = message/types.cpp
Patrick Williams43b283a2017-05-01 14:15:54 -050045message_types_LDADD = $(gtest_ldadd)
Patrick Williams83a9d0b2016-11-04 17:06:13 -050046
47check_PROGRAMS += utility_tuple_to_array
48utility_tuple_to_array_SOURCES = utility/tuple_to_array.cpp
Patrick Williams43b283a2017-05-01 14:15:54 -050049utility_tuple_to_array_LDADD = $(gtest_ldadd)
Patrick Williams83a9d0b2016-11-04 17:06:13 -050050
51check_PROGRAMS += utility_type_traits
52utility_type_traits_SOURCES = utility/type_traits.cpp
William A. Kennington III977d4d42018-06-23 00:33:08 -070053utility_type_traits_LDADD = $(gtest_ldadd)
Patrick Williams83a9d0b2016-11-04 17:06:13 -050054
55check_PROGRAMS += vtable_vtable
56vtable_vtable_SOURCES = vtable/vtable.cpp vtable/vtable_c.c
Patrick Williams43b283a2017-05-01 14:15:54 -050057vtable_vtable_LDADD = $(gtest_ldadd)
Patrick Williams83a9d0b2016-11-04 17:06:13 -050058
Vernon Mauery7efcdae2018-09-06 06:34:39 -070059check_PROGRAMS += timer
60timer_SOURCES = timer.cpp
61timer_LDADD = $(gtest_ldadd)
62
Lei YUe57c38e2019-09-20 17:38:17 +080063server/Test/server.hpp:
64 @mkdir -p $(@D)
65 @top_srcdir@/tools/sdbus++ \
66 -r $(srcdir) -t $(top_builddir)/tools/sdbusplus/templates \
67 interface server-header server.Test > $@
68
69server/Test/server.cpp:
70 @mkdir -p $(@D)
71 @top_srcdir@/tools/sdbus++ \
72 -r $(srcdir) -t $(top_builddir)/tools/sdbusplus/templates \
73 interface server-cpp server.Test > $@
74
75server_test_generated_sources = server/Test/server.cpp server/Test/server.hpp
76
77BUILT_SOURCES = $(server_test_generated_sources)
78CLEANFILES = $(server_test_generated_sources)
79
80check_PROGRAMS += object
81object_SOURCES = server/object.cpp $(server_test_generated_sources)
82object_LDADD = $(gtest_ldadd)
83
Brad Bishop14275cf2016-11-10 16:24:48 -050084endif