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