Tests: add string-utils library unit tests
[lttng-tools.git] / tests / unit / Makefile.am
1 SUBDIRS = ini_config
2
3 AM_CFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/src -I$(top_srcdir)/tests/utils/ -I$(srcdir)
4 AM_LDFLAGS =
5
6 LOG_DRIVER_FLAGS='--merge'
7 LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
8 $(top_srcdir)/config/tap-driver.sh
9
10 TESTS = test_kernel_data \
11 test_session \
12 test_uri \
13 test_utils_parse_size_suffix \
14 test_utils_expand_path \
15 test_string_utils \
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
33 # Define test programs
34 noinst_PROGRAMS = test_uri test_session test_kernel_data
35 noinst_PROGRAMS += test_utils_parse_size_suffix test_utils_expand_path
36 noinst_PROGRAMS += test_string_utils
37
38 if HAVE_LIBLTTNG_UST_CTL
39 noinst_PROGRAMS += test_ust_data
40 TESTS += test_ust_data
41 endif
42
43 # URI unit tests
44 test_uri_SOURCES = test_uri.c
45 test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE)
46
47 # Session unit test
48 SESSIONS=$(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \
49 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
50 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
51 $(top_builddir)/src/bin/lttng-sessiond/snapshot.$(OBJEXT) \
52 $(top_builddir)/src/bin/lttng-sessiond/ht-cleanup.$(OBJEXT) \
53 $(top_builddir)/src/common/libcommon.la \
54 $(top_builddir)/src/common/testpoint/libtestpoint.la \
55 $(top_builddir)/src/common/compat/libcompat.la \
56 $(top_builddir)/src/common/health/libhealth.la \
57 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
58
59
60 test_session_SOURCES = test_session.c
61 test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
62 $(LIBHASHTABLE) -lrt
63 test_session_LDADD += $(SESSIONS)
64
65 # UST data structures unit test
66 if HAVE_LIBLTTNG_UST_CTL
67 UST_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-ust.$(OBJEXT) \
68 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
69 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
70 $(top_builddir)/src/bin/lttng-sessiond/buffer-registry.$(OBJEXT) \
71 $(top_builddir)/src/bin/lttng-sessiond/ust-registry.$(OBJEXT) \
72 $(top_builddir)/src/bin/lttng-sessiond/ust-metadata.$(OBJEXT) \
73 $(top_builddir)/src/bin/lttng-sessiond/ust-app.$(OBJEXT) \
74 $(top_builddir)/src/bin/lttng-sessiond/ust-consumer.$(OBJEXT) \
75 $(top_builddir)/src/bin/lttng-sessiond/fd-limit.$(OBJEXT) \
76 $(top_builddir)/src/bin/lttng-sessiond/session.$(OBJEXT) \
77 $(top_builddir)/src/bin/lttng-sessiond/snapshot.$(OBJEXT) \
78 $(top_builddir)/src/bin/lttng-sessiond/agent.$(OBJEXT) \
79 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
80 $(top_builddir)/src/common/libcommon.la \
81 $(top_builddir)/src/common/health/libhealth.la \
82 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
83
84 test_ust_data_SOURCES = test_ust_data.c
85 test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM)\
86 $(LIBHASHTABLE) -lrt -llttng-ust-ctl
87 test_ust_data_LDADD += $(UST_DATA_TRACE)
88 endif
89
90 # Kernel data structures unit test
91 KERN_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-kernel.$(OBJEXT) \
92 $(top_builddir)/src/bin/lttng-sessiond/consumer.$(OBJEXT) \
93 $(top_builddir)/src/bin/lttng-sessiond/utils.$(OBJEXT) \
94 $(top_builddir)/src/common/libcommon.la \
95 $(top_builddir)/src/common/health/libhealth.la \
96 $(top_builddir)/src/bin/lttng-sessiond/notification-thread-commands.$(OBJEXT) \
97 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
98
99 test_kernel_data_SOURCES = test_kernel_data.c
100 test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
101 $(LIBHASHTABLE) -lrt
102 test_kernel_data_LDADD += $(KERN_DATA_TRACE)
103
104 # utils suffix for unit test
105 UTILS_SUFFIX=$(top_builddir)/src/common/libcommon.la
106
107 # parse_size_suffix unit test
108 test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c
109 test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
110 test_utils_parse_size_suffix_LDADD += $(UTILS_SUFFIX)
111
112 # expand_path unit test
113 test_utils_expand_path_SOURCES = test_utils_expand_path.c
114 test_utils_expand_path_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
115 test_utils_expand_path_LDADD += $(UTILS_SUFFIX)
116
117 # string utilities unit test
118 test_string_utils_SOURCES = test_string_utils.c
119 test_string_utils_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBSTRINGUTILS)
This page took 0.032159 seconds and 5 git commands to generate.