2c7365912dc106b2ed192252d5bc1e587584896d
[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_expand_path \
14 test_string_utils \
15 test_notification \
16 ini_config/test_ini_config
17
18 if LTTNG_TOOLS_BUILD_WITH_LIBDL
19 LIBS += -ldl
20 endif
21 if LTTNG_TOOLS_BUILD_WITH_LIBC_DL
22 LIBS += -lc
23 endif
24
25 LIBTAP=$(top_builddir)/tests/utils/tap/libtap.la
26
27 LIBCOMMON=$(top_builddir)/src/common/libcommon.la
28 LIBSTRINGUTILS=$(top_builddir)/src/common/string-utils/libstring-utils.la
29 LIBSESSIOND_COMM=$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
30 LIBHASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la
31 LIBRELAYD=$(top_builddir)/src/common/relayd/librelayd.la
32 LIBLTTNG_CTL=$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la
33
34 # Define test programs
35 noinst_PROGRAMS = test_uri test_session test_kernel_data
36 noinst_PROGRAMS += test_utils_parse_size_suffix test_utils_expand_path
37 noinst_PROGRAMS += test_string_utils test_notification
38
39 if HAVE_LIBLTTNG_UST_CTL
40 noinst_PROGRAMS += test_ust_data
41 TESTS += test_ust_data
42 endif
43
44 # URI unit tests
45 test_uri_SOURCES = test_uri.c
46 test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE)
47
48 # Session unit test
49 SESSIONS=$(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \
50 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
51 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
52 $(top_builddir)/src/bin/lttng-sessiond/snapshot.$(OBJEXT) \
53 $(top_builddir)/src/bin/lttng-sessiond/ht-cleanup.$(OBJEXT) \
54 $(top_builddir)/src/common/libcommon.la \
55 $(top_builddir)/src/common/testpoint/libtestpoint.la \
56 $(top_builddir)/src/common/compat/libcompat.la \
57 $(top_builddir)/src/common/health/libhealth.la \
58 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
59
60
61 test_session_SOURCES = test_session.c
62 test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
63 $(LIBHASHTABLE) -lrt
64 test_session_LDADD += $(SESSIONS)
65
66 # UST data structures unit test
67 if HAVE_LIBLTTNG_UST_CTL
68 UST_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-ust.$(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/buffer-registry.$(OBJEXT) \
72 $(top_builddir)/src/bin/lttng-sessiond/ust-registry.$(OBJEXT) \
73 $(top_builddir)/src/bin/lttng-sessiond/ust-metadata.$(OBJEXT) \
74 $(top_builddir)/src/bin/lttng-sessiond/ust-app.$(OBJEXT) \
75 $(top_builddir)/src/bin/lttng-sessiond/ust-consumer.$(OBJEXT) \
76 $(top_builddir)/src/bin/lttng-sessiond/fd-limit.$(OBJEXT) \
77 $(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \
78 $(top_builddir)/src/bin/lttng-sessiond/snapshot.$(OBJEXT) \
79 $(top_builddir)/src/bin/lttng-sessiond/agent.$(OBJEXT) \
80 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
81 $(top_builddir)/src/common/libcommon.la \
82 $(top_builddir)/src/common/health/libhealth.la \
83 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
84
85 test_ust_data_SOURCES = test_ust_data.c
86 test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM)\
87 $(LIBHASHTABLE) -lrt -llttng-ust-ctl
88 test_ust_data_LDADD += $(UST_DATA_TRACE)
89 endif
90
91 # Kernel data structures unit test
92 KERN_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \
93 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
94 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
95 $(top_builddir)/src/common/libcommon.la \
96 $(top_builddir)/src/common/health/libhealth.la \
97 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
98 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
99
100 test_kernel_data_SOURCES = test_kernel_data.c
101 test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
102 $(LIBHASHTABLE) -lrt
103 test_kernel_data_LDADD += $(KERN_DATA_TRACE)
104
105 # utils suffix for unit test
106 UTILS_SUFFIX=$(top_builddir)/src/common/libcommon.la
107
108 # parse_size_suffix unit test
109 test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c
110 test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
111 test_utils_parse_size_suffix_LDADD += $(UTILS_SUFFIX)
112
113 # expand_path unit test
114 test_utils_expand_path_SOURCES = test_utils_expand_path.c
115 test_utils_expand_path_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
116 test_utils_expand_path_LDADD += $(UTILS_SUFFIX)
117
118 # string utilities unit test
119 test_string_utils_SOURCES = test_string_utils.c
120 test_string_utils_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSTRINGUTILS)
121 #
122 # Notification api
123 test_notification_SOURCES = test_notification.c
124 test_notification_LDADD = $(LIBTAP) $(LIBLTTNG_CTL)
This page took 0.047474 seconds and 4 git commands to generate.