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)/config/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=$(top_builddir)/src/common/libcommon.la
40 LIBSTRINGUTILS=$(top_builddir)/src/common/string-utils/libstring-utils.la
41 LIBFDTRACKER=$(top_builddir)/src/common/fd-tracker/libfd-tracker.la
42 LIBSESSIOND_COMM=$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
43 LIBHASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la
44 LIBRELAYD=$(top_builddir)/src/common/relayd/librelayd.la
45 LIBLTTNG_CTL=$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.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.c
81 test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE) $(DL_LIBS)
84 SESSIOND_OBJS = $(top_builddir)/src/bin/lttng-sessiond/buffer-registry.$(OBJEXT) \
85 $(top_builddir)/src/bin/lttng-sessiond/cmd.$(OBJEXT) \
86 $(top_builddir)/src/bin/lttng-sessiond/condition-internal.$(OBJEXT) \
87 $(top_builddir)/src/bin/lttng-sessiond/save.$(OBJEXT) \
88 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
89 $(top_builddir)/src/bin/lttng-sessiond/kernel.$(OBJEXT) \
90 $(top_builddir)/src/bin/lttng-sessiond/ht-cleanup.$(OBJEXT) \
91 $(top_builddir)/src/bin/lttng-sessiond/notification-thread.$(OBJEXT) \
92 $(top_builddir)/src/bin/lttng-sessiond/action-executor.$(OBJEXT) \
93 $(top_builddir)/src/bin/lttng-sessiond/lttng-syscall.$(OBJEXT) \
94 $(top_builddir)/src/bin/lttng-sessiond/channel.$(OBJEXT) \
95 $(top_builddir)/src/bin/lttng-sessiond/agent.$(OBJEXT) \
96 $(top_builddir)/src/bin/lttng-sessiond/kernel-consumer.$(OBJEXT) \
97 $(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \
98 $(top_builddir)/src/bin/lttng-sessiond/rotation-thread.$(OBJEXT) \
99 $(top_builddir)/src/bin/lttng-sessiond/context.$(OBJEXT) \
100 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
101 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
102 $(top_builddir)/src/bin/lttng-sessiond/fd-limit.$(OBJEXT) \
103 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-events.$(OBJEXT) \
104 $(top_builddir)/src/bin/lttng-sessiond/event.$(OBJEXT) \
105 $(top_builddir)/src/bin/lttng-sessiond/event-notifier-error-accounting.$(OBJEXT) \
106 $(top_builddir)/src/bin/lttng-sessiond/timer.$(OBJEXT) \
107 $(top_builddir)/src/bin/lttng-sessiond/snapshot.$(OBJEXT) \
108 $(top_builddir)/src/bin/lttng-sessiond/sessiond-config.$(OBJEXT) \
109 $(top_builddir)/src/bin/lttng-sessiond/rotate.$(OBJEXT) \
110 $(top_builddir)/src/bin/lttng-sessiond/modprobe.$(OBJEXT) \
111 $(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \
112 $(top_builddir)/src/bin/lttng-sessiond/globals.$(OBJEXT) \
113 $(top_builddir)/src/bin/lttng-sessiond/thread-utils.$(OBJEXT) \
114 $(top_builddir)/src/bin/lttng-sessiond/process-utils.$(OBJEXT) \
115 $(top_builddir)/src/bin/lttng-sessiond/thread.$(OBJEXT) \
116 $(top_builddir)/src/bin/lttng-sessiond/tracker.$(OBJEXT) \
117 $(top_builddir)/src/common/libcommon.la \
118 $(top_builddir)/src/common/testpoint/libtestpoint.la \
119 $(top_builddir)/src/common/compat/libcompat.la \
120 $(top_builddir)/src/common/health/libhealth.la \
121 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
123 if HAVE_LIBLTTNG_UST_CTL
124 SESSIOND_OBJS += $(top_builddir)/src/bin/lttng-sessiond/trace-ust.$(OBJEXT) \
125 $(top_builddir)/src/bin/lttng-sessiond/ust-registry.$(OBJEXT) \
126 $(top_builddir)/src/bin/lttng-sessiond/ust-app.$(OBJEXT) \
127 $(top_builddir)/src/bin/lttng-sessiond/ust-consumer.$(OBJEXT) \
128 $(top_builddir)/src/bin/lttng-sessiond/notify-apps.$(OBJEXT) \
129 $(top_builddir)/src/bin/lttng-sessiond/ust-metadata.$(OBJEXT) \
130 $(top_builddir)/src/bin/lttng-sessiond/agent-thread.$(OBJEXT) \
131 $(top_builddir)/src/bin/lttng-sessiond/ust-field-utils.$(OBJEXT)
134 RELAYD_OBJS = $(top_builddir)/src/bin/lttng-relayd/backward-compatibility-group-by.$(OBJEXT)
136 test_session_SOURCES = test_session.c
137 test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
138 $(LIBHASHTABLE) $(DL_LIBS) -lrt $(URCU_LIBS) \
140 $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
141 $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \
142 $(top_builddir)/src/common/compat/libcompat.la \
143 $(top_builddir)/src/common/testpoint/libtestpoint.la \
144 $(top_builddir)/src/common/health/libhealth.la \
145 $(top_builddir)/src/common/config/libconfig.la \
146 $(top_builddir)/src/common/string-utils/libstring-utils.la
148 test_session_LDADD += $(SESSIOND_OBJS)
150 if HAVE_LIBLTTNG_UST_CTL
151 test_session_LDADD += $(UST_CTL_LIBS)
154 # UST data structures unit test
155 if HAVE_LIBLTTNG_UST_CTL
156 test_ust_data_SOURCES = test_ust_data.c
157 test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
158 $(LIBHASHTABLE) $(DL_LIBS) -lrt $(URCU_LIBS) \
161 $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
162 $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \
163 $(top_builddir)/src/common/compat/libcompat.la \
164 $(top_builddir)/src/common/testpoint/libtestpoint.la \
165 $(top_builddir)/src/common/health/libhealth.la \
166 $(top_builddir)/src/common/config/libconfig.la \
167 $(top_builddir)/src/common/string-utils/libstring-utils.la
168 test_ust_data_LDADD += $(SESSIOND_OBJS)
171 # Kernel data structures unit test
172 KERN_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \
173 $(top_builddir)/src/common/compat/libcompat.la \
174 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
175 $(top_builddir)/src/bin/lttng-sessiond/globals.$(OBJEXT) \
176 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
177 $(top_builddir)/src/bin/lttng-sessiond/tracker.$(OBJEXT) \
178 $(top_builddir)/src/common/health/libhealth.la \
179 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
182 test_kernel_data_SOURCES = test_kernel_data.c
183 test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
184 $(LIBHASHTABLE) $(DL_LIBS) -lrt
185 test_kernel_data_LDADD += $(KERN_DATA_TRACE)
187 # utils suffix for unit test
189 # parse_size_suffix unit test
190 test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c
191 test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
193 # parse_time_suffix unit test
194 test_utils_parse_time_suffix_SOURCES = test_utils_parse_time_suffix.c
195 test_utils_parse_time_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
197 # compat_poll unit test
198 test_utils_compat_poll_SOURCES = test_utils_compat_poll.c
199 test_utils_compat_poll_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(DL_LIBS) \
200 $(top_builddir)/src/common/compat/libcompat.la $(LIBCOMMON)
202 # compat_pthread unit test
203 test_utils_compat_pthread_SOURCES = test_utils_compat_pthread.c
204 test_utils_compat_pthread_LDADD = $(LIBTAP) \
205 $(top_builddir)/src/common/compat/libcompat.la $(LIBCOMMON)
207 # expand_path unit test
208 test_utils_expand_path_SOURCES = test_utils_expand_path.c
209 test_utils_expand_path_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
211 # directory handle unit test
212 test_directory_handle_SOURCES = test_directory_handle.c
213 test_directory_handle_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
215 # string utilities unit test
216 test_string_utils_SOURCES = test_string_utils.c
217 test_string_utils_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSTRINGUTILS) $(DL_LIBS)
220 test_notification_SOURCES = test_notification.c
221 test_notification_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) $(DL_LIBS)
224 test_event_rule_SOURCES = test_event_rule.c
225 test_event_rule_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS) \
226 $(top_builddir)/src/bin/lttng/lttng-loglevel.$(OBJEXT)
229 test_condition_SOURCES = test_condition.c
230 test_condition_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
232 # relayd backward compat for groou-by-session utilities
233 test_relayd_backward_compat_group_by_session_SOURCES = test_relayd_backward_compat_group_by_session.c
234 test_relayd_backward_compat_group_by_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(RELAYD_OBJS)
235 test_relayd_backward_compat_group_by_session_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/bin/lttng-relayd
237 # firing policy object unit test
238 test_firing_policy_SOURCES = test_firing_policy.c
239 test_firing_policy_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS) \
240 $(top_builddir)/src/bin/lttng/lttng-loglevel.$(OBJEXT)
242 # fd tracker unit test
243 test_fd_tracker_SOURCES = test_fd_tracker.c
244 test_fd_tracker_LDADD = $(LIBTAP) $(LIBFDTRACKER) $(DL_LIBS) $(URCU_LIBS) $(LIBCOMMON) $(LIBHASHTABLE)
247 test_uuid_SOURCES = test_uuid.c
248 test_uuid_LDADD = $(LIBTAP) $(LIBCOMMON)
250 # buffer view unit test
251 test_buffer_view_SOURCES = test_buffer_view.c
252 test_buffer_view_LDADD = $(LIBTAP) $(LIBCOMMON)
255 test_payload_SOURCES = test_payload.c
256 test_payload_LDADD = $(LIBTAP) $(LIBSESSIOND_COMM) $(LIBCOMMON)
259 test_unix_socket_SOURCES = test_unix_socket.c
260 test_unix_socket_LDADD = $(LIBTAP) $(LIBSESSIOND_COMM) $(LIBCOMMON)
262 # Kernel probe location api test
263 test_kernel_probe_SOURCES = test_kernel_probe.c
264 test_kernel_probe_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
266 # Event expression to bytecode test
267 test_event_expr_to_bytecode_SOURCES = test_event_expr_to_bytecode.c
268 test_event_expr_to_bytecode_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) $(LIBCOMMON)
271 test_log_level_rule_SOURCES = test_log_level_rule.c
272 test_log_level_rule_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
275 test_action_SOURCES = test_action.c
276 test_action_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)