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