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