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