Clean-up: sort noinst_PROGRAMS in test/unit/Makefile.am
[lttng-tools.git] / tests / unit / Makefile.am
1 # SPDX-License-Identifier: GPL-2.0-only
2
3 SUBDIRS = ini_config
4
5 AM_CPPFLAGS += -I$(top_srcdir)/tests/utils/ -I$(srcdir)
6
7 LOG_DRIVER_FLAGS='--merge'
8 LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
9 $(top_srcdir)/config/tap-driver.sh
10
11 TESTS = \
12 ini_config/test_ini_config \
13 test_buffer_view \
14 test_directory_handle \
15 test_event_expr_to_bytecode \
16 test_event_rule \
17 test_fd_tracker \
18 test_kernel_data \
19 test_kernel_probe \
20 test_notification \
21 test_payload \
22 test_relayd_backward_compat_group_by_session \
23 test_session \
24 test_string_utils \
25 test_unix_socket \
26 test_uri \
27 test_utils_compat_poll \
28 test_utils_compat_pthread \
29 test_utils_expand_path \
30 test_utils_parse_size_suffix \
31 test_utils_parse_time_suffix \
32 test_uuid
33
34 LIBTAP=$(top_builddir)/tests/utils/tap/libtap.la
35
36 LIBCOMMON=$(top_builddir)/src/common/libcommon.la
37 LIBSTRINGUTILS=$(top_builddir)/src/common/string-utils/libstring-utils.la
38 LIBFDTRACKER=$(top_builddir)/src/common/fd-tracker/libfd-tracker.la
39 LIBSESSIOND_COMM=$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
40 LIBHASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la
41 LIBRELAYD=$(top_builddir)/src/common/relayd/librelayd.la
42 LIBLTTNG_CTL=$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la
43
44 # Define test programs
45 noinst_PROGRAMS = \
46 test_buffer_view \
47 test_condition \
48 test_directory_handle \
49 test_event_expr_to_bytecode \
50 test_event_rule \
51 test_fd_tracker \
52 test_kernel_data \
53 test_kernel_probe \
54 test_notification \
55 test_payload \
56 test_relayd_backward_compat_group_by_session \
57 test_session \
58 test_string_utils \
59 test_unix_socket \
60 test_uri \
61 test_utils_compat_poll \
62 test_utils_compat_pthread \
63 test_utils_expand_path \
64 test_utils_parse_size_suffix \
65 test_utils_parse_time_suffix \
66 test_uuid
67
68 if HAVE_LIBLTTNG_UST_CTL
69 noinst_PROGRAMS += test_ust_data
70 TESTS += test_ust_data
71 endif
72
73 # URI unit tests
74 test_uri_SOURCES = test_uri.c
75 test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE) $(DL_LIBS)
76
77 # Sessiond objects
78 SESSIOND_OBJS = $(top_builddir)/src/bin/lttng-sessiond/buffer-registry.$(OBJEXT) \
79 $(top_builddir)/src/bin/lttng-sessiond/cmd.$(OBJEXT) \
80 $(top_builddir)/src/bin/lttng-sessiond/condition-internal.$(OBJEXT) \
81 $(top_builddir)/src/bin/lttng-sessiond/save.$(OBJEXT) \
82 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
83 $(top_builddir)/src/bin/lttng-sessiond/shm.$(OBJEXT) \
84 $(top_builddir)/src/bin/lttng-sessiond/kernel.$(OBJEXT) \
85 $(top_builddir)/src/bin/lttng-sessiond/ht-cleanup.$(OBJEXT) \
86 $(top_builddir)/src/bin/lttng-sessiond/notification-thread.$(OBJEXT) \
87 $(top_builddir)/src/bin/lttng-sessiond/action-executor.$(OBJEXT) \
88 $(top_builddir)/src/bin/lttng-sessiond/lttng-syscall.$(OBJEXT) \
89 $(top_builddir)/src/bin/lttng-sessiond/channel.$(OBJEXT) \
90 $(top_builddir)/src/bin/lttng-sessiond/agent.$(OBJEXT) \
91 $(top_builddir)/src/bin/lttng-sessiond/kernel-consumer.$(OBJEXT) \
92 $(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \
93 $(top_builddir)/src/bin/lttng-sessiond/rotation-thread.$(OBJEXT) \
94 $(top_builddir)/src/bin/lttng-sessiond/context.$(OBJEXT) \
95 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
96 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
97 $(top_builddir)/src/bin/lttng-sessiond/fd-limit.$(OBJEXT) \
98 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-events.$(OBJEXT) \
99 $(top_builddir)/src/bin/lttng-sessiond/event.$(OBJEXT) \
100 $(top_builddir)/src/bin/lttng-sessiond/timer.$(OBJEXT) \
101 $(top_builddir)/src/bin/lttng-sessiond/snapshot.$(OBJEXT) \
102 $(top_builddir)/src/bin/lttng-sessiond/sessiond-config.$(OBJEXT) \
103 $(top_builddir)/src/bin/lttng-sessiond/rotate.$(OBJEXT) \
104 $(top_builddir)/src/bin/lttng-sessiond/modprobe.$(OBJEXT) \
105 $(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \
106 $(top_builddir)/src/bin/lttng-sessiond/globals.$(OBJEXT) \
107 $(top_builddir)/src/bin/lttng-sessiond/thread-utils.$(OBJEXT) \
108 $(top_builddir)/src/bin/lttng-sessiond/process-utils.$(OBJEXT) \
109 $(top_builddir)/src/bin/lttng-sessiond/thread.$(OBJEXT) \
110 $(top_builddir)/src/bin/lttng-sessiond/tracker.$(OBJEXT) \
111 $(top_builddir)/src/common/libcommon.la \
112 $(top_builddir)/src/common/testpoint/libtestpoint.la \
113 $(top_builddir)/src/common/compat/libcompat.la \
114 $(top_builddir)/src/common/health/libhealth.la \
115 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
116
117 if HAVE_LIBLTTNG_UST_CTL
118 SESSIOND_OBJS += $(top_builddir)/src/bin/lttng-sessiond/trace-ust.$(OBJEXT) \
119 $(top_builddir)/src/bin/lttng-sessiond/ust-registry.$(OBJEXT) \
120 $(top_builddir)/src/bin/lttng-sessiond/ust-app.$(OBJEXT) \
121 $(top_builddir)/src/bin/lttng-sessiond/ust-consumer.$(OBJEXT) \
122 $(top_builddir)/src/bin/lttng-sessiond/notify-apps.$(OBJEXT) \
123 $(top_builddir)/src/bin/lttng-sessiond/ust-metadata.$(OBJEXT) \
124 $(top_builddir)/src/bin/lttng-sessiond/agent-thread.$(OBJEXT) \
125 $(top_builddir)/src/bin/lttng-sessiond/ust-field-utils.$(OBJEXT)
126 endif
127
128 RELAYD_OBJS = $(top_builddir)/src/bin/lttng-relayd/backward-compatibility-group-by.$(OBJEXT)
129
130 test_session_SOURCES = test_session.c
131 test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
132 $(LIBHASHTABLE) $(DL_LIBS) -lrt $(URCU_LIBS) \
133 $(KMOD_LIBS) \
134 $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
135 $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \
136 $(top_builddir)/src/common/compat/libcompat.la \
137 $(top_builddir)/src/common/testpoint/libtestpoint.la \
138 $(top_builddir)/src/common/health/libhealth.la \
139 $(top_builddir)/src/common/config/libconfig.la \
140 $(top_builddir)/src/common/string-utils/libstring-utils.la
141
142 test_session_LDADD += $(SESSIOND_OBJS)
143
144 if HAVE_LIBLTTNG_UST_CTL
145 test_session_LDADD += $(UST_CTL_LIBS)
146 endif
147
148 # UST data structures unit test
149 if HAVE_LIBLTTNG_UST_CTL
150 test_ust_data_SOURCES = test_ust_data.c
151 test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
152 $(LIBHASHTABLE) $(DL_LIBS) -lrt $(URCU_LIBS) \
153 $(UST_CTL_LIBS) \
154 $(KMOD_LIBS) \
155 $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
156 $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \
157 $(top_builddir)/src/common/compat/libcompat.la \
158 $(top_builddir)/src/common/testpoint/libtestpoint.la \
159 $(top_builddir)/src/common/health/libhealth.la \
160 $(top_builddir)/src/common/config/libconfig.la \
161 $(top_builddir)/src/common/string-utils/libstring-utils.la
162 test_ust_data_LDADD += $(SESSIOND_OBJS)
163 endif
164
165 # Kernel data structures unit test
166 KERN_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \
167 $(top_builddir)/src/common/compat/libcompat.la \
168 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
169 $(top_builddir)/src/bin/lttng-sessiond/globals.$(OBJEXT) \
170 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
171 $(top_builddir)/src/bin/lttng-sessiond/tracker.$(OBJEXT) \
172 $(top_builddir)/src/common/health/libhealth.la \
173 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
174 $(LIBLTTNG_CTL)
175
176 test_kernel_data_SOURCES = test_kernel_data.c
177 test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
178 $(LIBHASHTABLE) $(DL_LIBS) -lrt
179 test_kernel_data_LDADD += $(KERN_DATA_TRACE)
180
181 # utils suffix for unit test
182
183 # parse_size_suffix unit test
184 test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c
185 test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
186
187 # parse_time_suffix unit test
188 test_utils_parse_time_suffix_SOURCES = test_utils_parse_time_suffix.c
189 test_utils_parse_time_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
190
191 # compat_poll unit test
192 test_utils_compat_poll_SOURCES = test_utils_compat_poll.c
193 test_utils_compat_poll_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(DL_LIBS) \
194 $(top_builddir)/src/common/compat/libcompat.la $(LIBCOMMON)
195
196 # compat_pthread unit test
197 test_utils_compat_pthread_SOURCES = test_utils_compat_pthread.c
198 test_utils_compat_pthread_LDADD = $(LIBTAP) \
199 $(top_builddir)/src/common/compat/libcompat.la $(LIBCOMMON)
200
201 # expand_path unit test
202 test_utils_expand_path_SOURCES = test_utils_expand_path.c
203 test_utils_expand_path_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
204
205 # directory handle unit test
206 test_directory_handle_SOURCES = test_directory_handle.c
207 test_directory_handle_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
208
209 # string utilities unit test
210 test_string_utils_SOURCES = test_string_utils.c
211 test_string_utils_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSTRINGUTILS) $(DL_LIBS)
212
213 # Notification api
214 test_notification_SOURCES = test_notification.c
215 test_notification_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) $(DL_LIBS)
216 #
217 # Event rule api
218 test_event_rule_SOURCES = test_event_rule.c
219 test_event_rule_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
220
221 # Condition api
222 test_condition_SOURCES = test_condition.c
223 test_condition_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
224
225 # relayd backward compat for groou-by-session utilities
226 test_relayd_backward_compat_group_by_session_SOURCES = test_relayd_backward_compat_group_by_session.c
227 test_relayd_backward_compat_group_by_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(RELAYD_OBJS)
228 test_relayd_backward_compat_group_by_session_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/bin/lttng-relayd
229
230 # fd tracker unit test
231 test_fd_tracker_SOURCES = test_fd_tracker.c
232 test_fd_tracker_LDADD = $(LIBTAP) $(LIBFDTRACKER) $(DL_LIBS) $(URCU_LIBS) $(LIBCOMMON) $(LIBHASHTABLE)
233
234 # uuid unit test
235 test_uuid_SOURCES = test_uuid.c
236 test_uuid_LDADD = $(LIBTAP) $(LIBCOMMON)
237
238 # buffer view unit test
239 test_buffer_view_SOURCES = test_buffer_view.c
240 test_buffer_view_LDADD = $(LIBTAP) $(LIBCOMMON)
241
242 # payload unit test
243 test_payload_SOURCES = test_payload.c
244 test_payload_LDADD = $(LIBTAP) $(LIBSESSIOND_COMM) $(LIBCOMMON)
245
246 # unix socket test
247 test_unix_socket_SOURCES = test_unix_socket.c
248 test_unix_socket_LDADD = $(LIBTAP) $(LIBSESSIOND_COMM) $(LIBCOMMON)
249
250 # Kernel probe location api test
251 test_kernel_probe_SOURCES = test_kernel_probe.c
252 test_kernel_probe_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
253 #
254 # Event expression to bytecode test
255 test_event_expr_to_bytecode_SOURCES = test_event_expr_to_bytecode.c
256 test_event_expr_to_bytecode_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) $(LIBCOMMON)
This page took 0.04898 seconds and 4 git commands to generate.