Tests: add unix socket wrapper unit tests
[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
11TESTS = test_kernel_data \
12 test_session \
13 test_uri \
14 test_utils_parse_size_suffix \
7010c033 15 test_utils_parse_time_suffix \
a36b26b4 16 test_utils_expand_path \
b12e3724 17 test_utils_compat_poll \
dbfea1ab 18 test_string_utils \
572cb877 19 test_notification \
93bed9fe 20 test_directory_handle \
73e9abbe 21 test_relayd_backward_compat_group_by_session \
9ca3e8a2 22 ini_config/test_ini_config \
c70636a7 23 test_fd_tracker \
67d8e2ef 24 test_uuid \
c0a66c84 25 test_buffer_view \
0b5a4de9
JG
26 test_payload \
27 test_unix_socket
a36b26b4 28
83c55082
CB
29LIBTAP=$(top_builddir)/tests/utils/tap/libtap.la
30
81d029da 31LIBCOMMON=$(top_builddir)/src/common/libcommon.la
dbfea1ab 32LIBSTRINGUTILS=$(top_builddir)/src/common/string-utils/libstring-utils.la
9ca3e8a2 33LIBFDTRACKER=$(top_builddir)/src/common/fd-tracker/libfd-tracker.la
81d029da
CB
34LIBSESSIOND_COMM=$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
35LIBHASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la
d3e2ba59 36LIBRELAYD=$(top_builddir)/src/common/relayd/librelayd.la
572cb877 37LIBLTTNG_CTL=$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la
81d029da 38
70d0b120 39# Define test programs
7010c033
SM
40noinst_PROGRAMS = test_uri test_session test_kernel_data \
41 test_utils_parse_size_suffix test_utils_parse_time_suffix \
b12e3724 42 test_utils_expand_path test_utils_compat_poll \
73e9abbe 43 test_string_utils test_notification test_directory_handle \
9ca3e8a2 44 test_relayd_backward_compat_group_by_session \
67d8e2ef 45 test_fd_tracker test_uuid \
c0a66c84 46 test_buffer_view \
0b5a4de9
JG
47 test_payload \
48 test_unix_socket
70d0b120 49
81d029da 50if HAVE_LIBLTTNG_UST_CTL
70d0b120 51noinst_PROGRAMS += test_ust_data
a36b26b4 52TESTS += test_ust_data
81d029da
CB
53endif
54
55# URI unit tests
56test_uri_SOURCES = test_uri.c
b1c46f87 57test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE) $(DL_LIBS)
81d029da 58
a7333da7
JG
59# Sessiond objects
60SESSIOND_OBJS = $(top_builddir)/src/bin/lttng-sessiond/buffer-registry.$(OBJEXT) \
a7333da7
JG
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) \
a7333da7
JG
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) \
827b3af0
MJ
75 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
76 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
a7333da7
JG
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) \
827b3af0 81 $(top_builddir)/src/bin/lttng-sessiond/snapshot.$(OBJEXT) \
a7333da7
JG
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) \
a3707772 89 $(top_builddir)/src/bin/lttng-sessiond/thread.$(OBJEXT) \
4e6581a7 90 $(top_builddir)/src/bin/lttng-sessiond/tracker.$(OBJEXT) \
9354f1d0 91 $(top_builddir)/src/common/libcommon.la \
5e97de00
JG
92 $(top_builddir)/src/common/testpoint/libtestpoint.la \
93 $(top_builddir)/src/common/compat/libcompat.la \
8782cc74
MD
94 $(top_builddir)/src/common/health/libhealth.la \
95 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
96
a7333da7
JG
97if HAVE_LIBLTTNG_UST_CTL
98SESSIOND_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) \
f9d2ba6a 102 $(top_builddir)/src/bin/lttng-sessiond/notify-apps.$(OBJEXT) \
a7333da7
JG
103 $(top_builddir)/src/bin/lttng-sessiond/ust-metadata.$(OBJEXT) \
104 $(top_builddir)/src/bin/lttng-sessiond/agent-thread.$(OBJEXT) \
4e6581a7 105 $(top_builddir)/src/bin/lttng-sessiond/ust-field-utils.$(OBJEXT)
a7333da7 106endif
81d029da 107
73e9abbe
JR
108RELAYD_OBJS = $(top_builddir)/src/bin/lttng-relayd/backward-compatibility-group-by.$(OBJEXT)
109
9a363369 110test_session_SOURCES = test_session.c
d3e2ba59 111test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
a7333da7
JG
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
122test_session_LDADD += $(SESSIOND_OBJS)
81d029da 123
81d029da 124if HAVE_LIBLTTNG_UST_CTL
20dd2de1 125test_session_LDADD += $(UST_CTL_LIBS)
a7333da7 126endif
81d029da 127
a7333da7
JG
128# UST data structures unit test
129if HAVE_LIBLTTNG_UST_CTL
9a363369 130test_ust_data_SOURCES = test_ust_data.c
a7333da7
JG
131test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
132 $(LIBHASHTABLE) $(DL_LIBS) -lrt -lurcu-common -lurcu \
20dd2de1 133 $(UST_CTL_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
142test_ust_data_LDADD += $(SESSIOND_OBJS)
81d029da
CB
143endif
144
145# Kernel data structures unit test
827b3af0 146KERN_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \
658f12fa 147 $(top_builddir)/src/common/compat/libcompat.la \
827b3af0 148 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
658f12fa 149 $(top_builddir)/src/bin/lttng-sessiond/globals.$(OBJEXT) \
827b3af0 150 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
55c9e7ca 151 $(top_builddir)/src/bin/lttng-sessiond/tracker.$(OBJEXT) \
8782cc74 152 $(top_builddir)/src/common/health/libhealth.la \
83b45089 153 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
dcabc190 154 $(LIBLTTNG_CTL)
81d029da 155
9a363369 156test_kernel_data_SOURCES = test_kernel_data.c
d3e2ba59 157test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
b1c46f87 158 $(LIBHASHTABLE) $(DL_LIBS) -lrt
9a363369 159test_kernel_data_LDADD += $(KERN_DATA_TRACE)
70d0b120 160
c77d8c84 161# utils suffix for unit test
70d0b120 162
c77d8c84 163# parse_size_suffix unit test
70d0b120 164test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c
b1c46f87 165test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
c77d8c84 166
7010c033
SM
167# parse_time_suffix unit test
168test_utils_parse_time_suffix_SOURCES = test_utils_parse_time_suffix.c
169test_utils_parse_time_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
7010c033 170
b12e3724
YL
171# compat_poll unit test
172test_utils_compat_poll_SOURCES = test_utils_compat_poll.c
173test_utils_compat_poll_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(DL_LIBS) \
174 $(top_builddir)/src/common/compat/libcompat.la $(LIBCOMMON)
175
cc7f9e36
RB
176# expand_path unit test
177test_utils_expand_path_SOURCES = test_utils_expand_path.c
b1c46f87 178test_utils_expand_path_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
dbfea1ab 179
93bed9fe
JG
180# directory handle unit test
181test_directory_handle_SOURCES = test_directory_handle.c
182test_directory_handle_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
183
dbfea1ab
PP
184# string utilities unit test
185test_string_utils_SOURCES = test_string_utils.c
b1c46f87
MJ
186test_string_utils_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSTRINGUTILS) $(DL_LIBS)
187
572cb877
JR
188# Notification api
189test_notification_SOURCES = test_notification.c
b1c46f87 190test_notification_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) $(DL_LIBS)
73e9abbe
JR
191
192# relayd backward compat for groou-by-session utilities
193test_relayd_backward_compat_group_by_session_SOURCES = test_relayd_backward_compat_group_by_session.c
194test_relayd_backward_compat_group_by_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(RELAYD_OBJS)
195test_relayd_backward_compat_group_by_session_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/bin/lttng-relayd
9ca3e8a2
JG
196
197# fd tracker unit test
198test_fd_tracker_SOURCES = test_fd_tracker.c
199test_fd_tracker_LDADD = $(LIBTAP) $(LIBFDTRACKER) $(DL_LIBS) -lurcu $(LIBCOMMON) $(LIBHASHTABLE)
c70636a7
MJ
200
201# uuid unit test
202test_uuid_SOURCES = test_uuid.c
203test_uuid_LDADD = $(LIBTAP) $(LIBCOMMON)
67d8e2ef
SM
204
205# buffer view unit test
206test_buffer_view_SOURCES = test_buffer_view.c
207test_buffer_view_LDADD = $(LIBTAP) $(LIBCOMMON)
c0a66c84
JG
208
209# payload unit test
210test_payload_SOURCES = test_payload.c
211test_payload_LDADD = $(LIBTAP) $(LIBSESSIOND_COMM) $(LIBCOMMON)
0b5a4de9
JG
212
213# unix socket test
214test_unix_socket_SOURCES = test_unix_socket.c
215test_unix_socket_LDADD = $(LIBTAP) $(LIBSESSIOND_COMM) $(LIBCOMMON)
This page took 0.101188 seconds and 5 git commands to generate.