1 # SPDX-License-Identifier: GPL-2.0-only
5 AM_CPPFLAGS += -I$(top_srcdir)/tests/utils/ -I$(srcdir)
7 LOG_DRIVER_FLAGS='--merge'
8 LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
9 $(top_srcdir)/tests/utils/tap-driver.sh
12 ini_config/test_ini_config \
15 test_directory_handle \
16 test_event_expr_to_bytecode \
25 test_relayd_backward_compat_group_by_session \
30 test_utils_compat_poll \
31 test_utils_compat_pthread \
32 test_utils_expand_path \
33 test_utils_parse_size_suffix \
34 test_utils_parse_time_suffix \
37 LIBTAP=$(top_builddir)/tests/utils/tap/libtap.la
39 LIBCOMMON_GPL=$(top_builddir)/src/common/libcommon-gpl.la
40 LIBSTRINGUTILS=$(top_builddir)/src/common/libstring-utils.la
41 LIBFDTRACKER=$(top_builddir)/src/common/libfd-tracker.la
42 LIBSESSIOND_COMM=$(top_builddir)/src/common/libsessiond-comm.la
43 LIBRELAYD=$(top_builddir)/src/common/librelayd.la
44 LIBLTTNG_CTL=$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la
45 LIBLTTNG_SESSIOND_COMMON=$(top_builddir)/src/bin/lttng-sessiond/liblttng-sessiond-common.la
47 # Define test programs
52 test_directory_handle \
53 test_event_expr_to_bytecode \
62 test_relayd_backward_compat_group_by_session \
67 test_utils_compat_poll \
68 test_utils_compat_pthread \
69 test_utils_expand_path \
70 test_utils_parse_size_suffix \
71 test_utils_parse_time_suffix \
74 if HAVE_LIBLTTNG_UST_CTL
75 noinst_PROGRAMS += test_ust_data
76 TESTS += test_ust_data
80 test_uri_SOURCES = test_uri.cpp
81 test_uri_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(DL_LIBS)
83 RELAYD_OBJS = $(top_builddir)/src/bin/lttng-relayd/backward-compatibility-group-by.$(OBJEXT)
85 test_session_SOURCES = test_session.cpp
86 test_session_LDADD = $(LIBTAP) $(LIBLTTNG_SESSIOND_COMMON) $(DL_LIBS)
88 if HAVE_LIBLTTNG_UST_CTL
89 test_session_SOURCES += ust-sigbus.cpp
90 test_session_LDADD += $(UST_CTL_LIBS)
93 # UST data structures unit test
94 if HAVE_LIBLTTNG_UST_CTL
95 test_ust_data_SOURCES = test_ust_data.cpp
96 test_ust_data_LDADD = $(LIBTAP) $(LIBLTTNG_SESSIOND_COMMON) $(DL_LIBS)
99 test_kernel_data_SOURCES = test_kernel_data.cpp
100 test_kernel_data_LDADD = $(LIBTAP) $(LIBLTTNG_SESSIOND_COMMON) $(DL_LIBS)
102 # utils suffix for unit test
104 # parse_size_suffix unit test
105 test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.cpp
106 test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(DL_LIBS)
108 # parse_time_suffix unit test
109 test_utils_parse_time_suffix_SOURCES = test_utils_parse_time_suffix.cpp
110 test_utils_parse_time_suffix_LDADD = $(LIBTAP) $(LIBCOMMON_GPL)
112 # compat_poll unit test
113 test_utils_compat_poll_SOURCES = test_utils_compat_poll.cpp
114 test_utils_compat_poll_LDADD = $(LIBTAP) $(DL_LIBS) \
115 $(top_builddir)/src/common/libcompat.la $(LIBCOMMON_GPL)
117 # compat_pthread unit test
118 test_utils_compat_pthread_SOURCES = test_utils_compat_pthread.cpp
119 test_utils_compat_pthread_LDADD = $(LIBTAP) \
120 $(top_builddir)/src/common/libcompat.la $(LIBCOMMON_GPL)
122 # expand_path unit test
123 test_utils_expand_path_SOURCES = test_utils_expand_path.cpp
124 test_utils_expand_path_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(DL_LIBS)
126 # directory handle unit test
127 test_directory_handle_SOURCES = test_directory_handle.cpp
128 test_directory_handle_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(DL_LIBS)
130 # string utilities unit test
131 test_string_utils_SOURCES = test_string_utils.cpp
132 test_string_utils_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(LIBSTRINGUTILS) $(DL_LIBS)
135 test_notification_SOURCES = test_notification.cpp
136 test_notification_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) $(DL_LIBS)
139 test_event_rule_SOURCES = test_event_rule.cpp
140 test_event_rule_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(LIBLTTNG_CTL) $(DL_LIBS) \
141 $(top_builddir)/src/bin/lttng/lttng-loglevel.$(OBJEXT)
144 test_condition_SOURCES = test_condition.cpp
145 test_condition_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(LIBLTTNG_CTL) $(DL_LIBS)
147 # relayd backward compat for groou-by-session utilities
148 test_relayd_backward_compat_group_by_session_SOURCES = test_relayd_backward_compat_group_by_session.cpp
149 test_relayd_backward_compat_group_by_session_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(RELAYD_OBJS)
150 test_relayd_backward_compat_group_by_session_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/bin/lttng-relayd
152 # rate policy object unit test
153 test_rate_policy_SOURCES = test_rate_policy.cpp
154 test_rate_policy_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(LIBLTTNG_CTL) $(DL_LIBS) \
155 $(top_builddir)/src/bin/lttng/lttng-loglevel.$(OBJEXT)
157 # fd tracker unit test
158 test_fd_tracker_SOURCES = test_fd_tracker.cpp
159 test_fd_tracker_LDADD = $(LIBTAP) $(LIBFDTRACKER) $(DL_LIBS) $(URCU_LIBS) $(LIBCOMMON_GPL)
162 test_uuid_SOURCES = test_uuid.cpp
163 test_uuid_LDADD = $(LIBTAP) $(LIBCOMMON_GPL)
165 # buffer view unit test
166 test_buffer_view_SOURCES = test_buffer_view.cpp
167 test_buffer_view_LDADD = $(LIBTAP) $(LIBCOMMON_GPL)
170 test_payload_SOURCES = test_payload.cpp
171 test_payload_LDADD = $(LIBTAP) $(LIBSESSIOND_COMM) $(LIBCOMMON_GPL)
174 test_unix_socket_SOURCES = test_unix_socket.cpp
175 test_unix_socket_LDADD = $(LIBTAP) $(LIBSESSIOND_COMM) $(LIBCOMMON_GPL)
177 # Kernel probe location api test
178 test_kernel_probe_SOURCES = test_kernel_probe.cpp
179 test_kernel_probe_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(LIBLTTNG_CTL) $(DL_LIBS)
181 # Event expression to bytecode test
182 test_event_expr_to_bytecode_SOURCES = test_event_expr_to_bytecode.cpp
183 test_event_expr_to_bytecode_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) $(LIBCOMMON_GPL)
186 test_log_level_rule_SOURCES = test_log_level_rule.cpp
187 test_log_level_rule_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(LIBLTTNG_CTL) $(DL_LIBS)
190 test_action_SOURCES = test_action.cpp
191 test_action_LDADD = $(LIBTAP) $(LIBCOMMON_GPL) $(LIBLTTNG_CTL) $(DL_LIBS)