lib: compile liblttng-ctl as C++
[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)/tests/utils/tap-driver.sh
10
11 TESTS = \
12 ini_config/test_ini_config \
13 test_action \
14 test_buffer_view \
15 test_directory_handle \
16 test_event_expr_to_bytecode \
17 test_event_rule \
18 test_fd_tracker \
19 test_rate_policy \
20 test_kernel_data \
21 test_kernel_probe \
22 test_log_level_rule \
23 test_notification \
24 test_payload \
25 test_relayd_backward_compat_group_by_session \
26 test_session \
27 test_string_utils \
28 test_unix_socket \
29 test_uri \
30 test_utils_compat_poll \
31 test_utils_compat_pthread \
32 test_utils_expand_path \
33 test_utils_parse_size_suffix \
34 test_utils_parse_time_suffix \
35 test_uuid
36
37 LIBTAP=$(top_builddir)/tests/utils/tap/libtap.la
38
39 LIBCOMMON=$(top_builddir)/src/common/libcommon.la
40 LIBSTRINGUTILS=$(top_builddir)/src/common/string-utils/libstring-utils.la
41 LIBFDTRACKER=$(top_builddir)/src/common/fd-tracker/libfd-tracker.la
42 LIBSESSIOND_COMM=$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
43 LIBHASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la
44 LIBRELAYD=$(top_builddir)/src/common/relayd/librelayd.la
45 LIBLTTNG_CTL=$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la
46 LIBLTTNG_SESSIOND_COMMON=$(top_builddir)/src/bin/lttng-sessiond/liblttng-sessiond-common.la
47
48 # Define test programs
49 noinst_PROGRAMS = \
50 test_action \
51 test_buffer_view \
52 test_condition \
53 test_directory_handle \
54 test_event_expr_to_bytecode \
55 test_event_rule \
56 test_fd_tracker \
57 test_rate_policy \
58 test_kernel_data \
59 test_kernel_probe \
60 test_log_level_rule \
61 test_notification \
62 test_payload \
63 test_relayd_backward_compat_group_by_session \
64 test_session \
65 test_string_utils \
66 test_unix_socket \
67 test_uri \
68 test_utils_compat_poll \
69 test_utils_compat_pthread \
70 test_utils_expand_path \
71 test_utils_parse_size_suffix \
72 test_utils_parse_time_suffix \
73 test_uuid
74
75 if HAVE_LIBLTTNG_UST_CTL
76 noinst_PROGRAMS += test_ust_data
77 TESTS += test_ust_data
78 endif
79
80 # URI unit tests
81 test_uri_SOURCES = test_uri.c
82 test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE) $(DL_LIBS)
83
84 RELAYD_OBJS = $(top_builddir)/src/bin/lttng-relayd/backward-compatibility-group-by.$(OBJEXT)
85
86 test_session_SOURCES = test_session.cpp
87 test_session_LDADD = $(LIBTAP) $(LIBLTTNG_SESSIOND_COMMON) $(DL_LIBS)
88
89 if HAVE_LIBLTTNG_UST_CTL
90 test_session_SOURCES += ust-sigbus.c
91 test_session_LDADD += $(UST_CTL_LIBS)
92 endif
93
94 # UST data structures unit test
95 if HAVE_LIBLTTNG_UST_CTL
96 test_ust_data_SOURCES = test_ust_data.cpp
97 test_ust_data_LDADD = $(LIBTAP) $(LIBLTTNG_SESSIOND_COMMON) $(DL_LIBS)
98 endif
99
100 test_kernel_data_SOURCES = test_kernel_data.cpp
101 test_kernel_data_LDADD = $(LIBTAP) $(LIBLTTNG_SESSIOND_COMMON) $(DL_LIBS)
102
103 # utils suffix for unit test
104
105 # parse_size_suffix unit test
106 test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c
107 test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
108
109 # parse_time_suffix unit test
110 test_utils_parse_time_suffix_SOURCES = test_utils_parse_time_suffix.c
111 test_utils_parse_time_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
112
113 # compat_poll unit test
114 test_utils_compat_poll_SOURCES = test_utils_compat_poll.c
115 test_utils_compat_poll_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(DL_LIBS) \
116 $(top_builddir)/src/common/compat/libcompat.la $(LIBCOMMON)
117
118 # compat_pthread unit test
119 test_utils_compat_pthread_SOURCES = test_utils_compat_pthread.c
120 test_utils_compat_pthread_LDADD = $(LIBTAP) \
121 $(top_builddir)/src/common/compat/libcompat.la $(LIBCOMMON)
122
123 # expand_path unit test
124 test_utils_expand_path_SOURCES = test_utils_expand_path.c
125 test_utils_expand_path_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
126
127 # directory handle unit test
128 test_directory_handle_SOURCES = test_directory_handle.c
129 test_directory_handle_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
130
131 # string utilities unit test
132 test_string_utils_SOURCES = test_string_utils.c
133 test_string_utils_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSTRINGUTILS) $(DL_LIBS)
134
135 # Notification api
136 test_notification_SOURCES = test_notification.c
137 test_notification_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) $(DL_LIBS)
138
139 # Event rule api
140 test_event_rule_SOURCES = test_event_rule.c
141 test_event_rule_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS) \
142 $(top_builddir)/src/bin/lttng/lttng-loglevel.$(OBJEXT)
143
144 # Condition api
145 test_condition_SOURCES = test_condition.c
146 test_condition_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
147
148 # relayd backward compat for groou-by-session utilities
149 test_relayd_backward_compat_group_by_session_SOURCES = test_relayd_backward_compat_group_by_session.cpp
150 test_relayd_backward_compat_group_by_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(RELAYD_OBJS)
151 test_relayd_backward_compat_group_by_session_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/src/bin/lttng-relayd
152
153 # rate policy object unit test
154 test_rate_policy_SOURCES = test_rate_policy.c
155 test_rate_policy_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS) \
156 $(top_builddir)/src/bin/lttng/lttng-loglevel.$(OBJEXT)
157
158 # fd tracker unit test
159 test_fd_tracker_SOURCES = test_fd_tracker.c
160 test_fd_tracker_LDADD = $(LIBTAP) $(LIBFDTRACKER) $(DL_LIBS) $(URCU_LIBS) $(LIBCOMMON) $(LIBHASHTABLE)
161
162 # uuid unit test
163 test_uuid_SOURCES = test_uuid.c
164 test_uuid_LDADD = $(LIBTAP) $(LIBCOMMON)
165
166 # buffer view unit test
167 test_buffer_view_SOURCES = test_buffer_view.c
168 test_buffer_view_LDADD = $(LIBTAP) $(LIBCOMMON)
169
170 # payload unit test
171 test_payload_SOURCES = test_payload.c
172 test_payload_LDADD = $(LIBTAP) $(LIBSESSIOND_COMM) $(LIBCOMMON)
173
174 # unix socket test
175 test_unix_socket_SOURCES = test_unix_socket.c
176 test_unix_socket_LDADD = $(LIBTAP) $(LIBSESSIOND_COMM) $(LIBCOMMON)
177
178 # Kernel probe location api test
179 test_kernel_probe_SOURCES = test_kernel_probe.c
180 test_kernel_probe_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
181 #
182 # Event expression to bytecode test
183 test_event_expr_to_bytecode_SOURCES = test_event_expr_to_bytecode.c
184 test_event_expr_to_bytecode_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) $(LIBCOMMON)
185
186 # Log level rule api
187 test_log_level_rule_SOURCES = test_log_level_rule.c
188 test_log_level_rule_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
189
190 # Action api
191 test_action_SOURCES = test_action.c
192 test_action_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBLTTNG_CTL) $(DL_LIBS)
This page took 0.035143 seconds and 4 git commands to generate.