Add Unit test to poll compatibility layer
[lttng-tools.git] / tests / unit / Makefile.am
1 SUBDIRS = ini_config
2
3 AM_CPPFLAGS += -I$(top_srcdir)/tests/utils/ -I$(srcdir)
4
5 LOG_DRIVER_FLAGS='--merge'
6 LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
7 $(top_srcdir)/config/tap-driver.sh
8
9 TESTS = test_kernel_data \
10 test_session \
11 test_uri \
12 test_utils_parse_size_suffix \
13 test_utils_parse_time_suffix \
14 test_utils_expand_path \
15 test_utils_compat_poll \
16 test_string_utils \
17 test_notification \
18 ini_config/test_ini_config
19
20 LIBTAP=$(top_builddir)/tests/utils/tap/libtap.la
21
22 LIBCOMMON=$(top_builddir)/src/common/libcommon.la
23 LIBSTRINGUTILS=$(top_builddir)/src/common/string-utils/libstring-utils.la
24 LIBSESSIOND_COMM=$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
25 LIBHASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la
26 LIBRELAYD=$(top_builddir)/src/common/relayd/librelayd.la
27 LIBLTTNG_CTL=$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la
28
29 # Define test programs
30 noinst_PROGRAMS = test_uri test_session test_kernel_data \
31 test_utils_parse_size_suffix test_utils_parse_time_suffix \
32 test_utils_expand_path test_utils_compat_poll \
33 test_string_utils test_notification
34
35 if HAVE_LIBLTTNG_UST_CTL
36 noinst_PROGRAMS += test_ust_data
37 TESTS += test_ust_data
38 endif
39
40 # URI unit tests
41 test_uri_SOURCES = test_uri.c
42 test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE) $(DL_LIBS)
43
44 # Sessiond objects
45 SESSIOND_OBJS = $(top_builddir)/src/bin/lttng-sessiond/buffer-registry.$(OBJEXT) \
46 $(top_builddir)/src/bin/lttng-sessiond/cmd.$(OBJEXT) \
47 $(top_builddir)/src/bin/lttng-sessiond/save.$(OBJEXT) \
48 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
49 $(top_builddir)/src/bin/lttng-sessiond/shm.$(OBJEXT) \
50 $(top_builddir)/src/bin/lttng-sessiond/kernel.$(OBJEXT) \
51 $(top_builddir)/src/bin/lttng-sessiond/ht-cleanup.$(OBJEXT) \
52 $(top_builddir)/src/bin/lttng-sessiond/notification-thread.$(OBJEXT) \
53 $(top_builddir)/src/bin/lttng-sessiond/lttng-syscall.$(OBJEXT) \
54 $(top_builddir)/src/bin/lttng-sessiond/channel.$(OBJEXT) \
55 $(top_builddir)/src/bin/lttng-sessiond/agent.$(OBJEXT) \
56 $(top_builddir)/src/bin/lttng-sessiond/kernel-consumer.$(OBJEXT) \
57 $(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \
58 $(top_builddir)/src/bin/lttng-sessiond/rotation-thread.$(OBJEXT) \
59 $(top_builddir)/src/bin/lttng-sessiond/context.$(OBJEXT) \
60 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
61 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
62 $(top_builddir)/src/bin/lttng-sessiond/fd-limit.$(OBJEXT) \
63 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-events.$(OBJEXT) \
64 $(top_builddir)/src/bin/lttng-sessiond/event.$(OBJEXT) \
65 $(top_builddir)/src/bin/lttng-sessiond/timer.$(OBJEXT) \
66 $(top_builddir)/src/bin/lttng-sessiond/snapshot.$(OBJEXT) \
67 $(top_builddir)/src/bin/lttng-sessiond/sessiond-config.$(OBJEXT) \
68 $(top_builddir)/src/bin/lttng-sessiond/rotate.$(OBJEXT) \
69 $(top_builddir)/src/bin/lttng-sessiond/modprobe.$(OBJEXT) \
70 $(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \
71 $(top_builddir)/src/bin/lttng-sessiond/globals.$(OBJEXT) \
72 $(top_builddir)/src/bin/lttng-sessiond/thread-utils.$(OBJEXT) \
73 $(top_builddir)/src/bin/lttng-sessiond/process-utils.$(OBJEXT) \
74 $(top_builddir)/src/bin/lttng-sessiond/thread.$(OBJEXT) \
75 $(top_builddir)/src/common/libcommon.la \
76 $(top_builddir)/src/common/testpoint/libtestpoint.la \
77 $(top_builddir)/src/common/compat/libcompat.la \
78 $(top_builddir)/src/common/health/libhealth.la \
79 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
80
81 if HAVE_LIBLTTNG_UST_CTL
82 SESSIOND_OBJS += $(top_builddir)/src/bin/lttng-sessiond/trace-ust.$(OBJEXT) \
83 $(top_builddir)/src/bin/lttng-sessiond/ust-registry.$(OBJEXT) \
84 $(top_builddir)/src/bin/lttng-sessiond/ust-app.$(OBJEXT) \
85 $(top_builddir)/src/bin/lttng-sessiond/ust-consumer.$(OBJEXT) \
86 $(top_builddir)/src/bin/lttng-sessiond/notify-apps.$(OBJEXT) \
87 $(top_builddir)/src/bin/lttng-sessiond/ust-metadata.$(OBJEXT) \
88 $(top_builddir)/src/bin/lttng-sessiond/agent-thread.$(OBJEXT) \
89 $(top_builddir)/src/bin/lttng-sessiond/ust-field-utils.$(OBJEXT)
90 endif
91
92 test_session_SOURCES = test_session.c
93 test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
94 $(LIBHASHTABLE) $(DL_LIBS) -lrt -lurcu-common -lurcu \
95 $(KMOD_LIBS) \
96 $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
97 $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \
98 $(top_builddir)/src/common/compat/libcompat.la \
99 $(top_builddir)/src/common/testpoint/libtestpoint.la \
100 $(top_builddir)/src/common/health/libhealth.la \
101 $(top_builddir)/src/common/config/libconfig.la \
102 $(top_builddir)/src/common/string-utils/libstring-utils.la
103
104 test_session_LDADD += $(SESSIOND_OBJS)
105
106 if HAVE_LIBLTTNG_UST_CTL
107 test_session_LDADD += -llttng-ust-ctl
108 endif
109
110 # UST data structures unit test
111 if HAVE_LIBLTTNG_UST_CTL
112 test_ust_data_SOURCES = test_ust_data.c
113 test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
114 $(LIBHASHTABLE) $(DL_LIBS) -lrt -lurcu-common -lurcu \
115 -llttng-ust-ctl \
116 $(KMOD_LIBS) \
117 $(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la \
118 $(top_builddir)/src/common/kernel-ctl/libkernel-ctl.la \
119 $(top_builddir)/src/common/compat/libcompat.la \
120 $(top_builddir)/src/common/testpoint/libtestpoint.la \
121 $(top_builddir)/src/common/health/libhealth.la \
122 $(top_builddir)/src/common/config/libconfig.la \
123 $(top_builddir)/src/common/string-utils/libstring-utils.la
124 test_ust_data_LDADD += $(SESSIOND_OBJS)
125 endif
126
127 # Kernel data structures unit test
128 KERN_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \
129 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
130 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
131 $(top_builddir)/src/common/health/libhealth.la \
132 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
133 $(LIBLTTNG_CTL)
134
135 test_kernel_data_SOURCES = test_kernel_data.c
136 test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
137 $(LIBHASHTABLE) $(DL_LIBS) -lrt
138 test_kernel_data_LDADD += $(KERN_DATA_TRACE)
139
140 # utils suffix for unit test
141
142 # parse_size_suffix unit test
143 test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c
144 test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
145
146 # parse_time_suffix unit test
147 test_utils_parse_time_suffix_SOURCES = test_utils_parse_time_suffix.c
148 test_utils_parse_time_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
149
150 # compat_poll unit test
151 test_utils_compat_poll_SOURCES = test_utils_compat_poll.c
152 test_utils_compat_poll_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(DL_LIBS) \
153 $(top_builddir)/src/common/compat/libcompat.la $(LIBCOMMON)
154
155 # expand_path unit test
156 test_utils_expand_path_SOURCES = test_utils_expand_path.c
157 test_utils_expand_path_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
158
159 # string utilities unit test
160 test_string_utils_SOURCES = test_string_utils.c
161 test_string_utils_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSTRINGUTILS) $(DL_LIBS)
162
163 # Notification api
164 test_notification_SOURCES = test_notification.c
165 test_notification_LDADD = $(LIBTAP) $(LIBLTTNG_CTL) $(DL_LIBS)
This page took 0.046342 seconds and 4 git commands to generate.