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