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