Tests: Replace prove by autotools tap runner
[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 = 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 ini_config/test_ini_config
15
16 if LTTNG_TOOLS_BUILD_WITH_LIBDL
17 LIBS += -ldl
18 endif
19 if LTTNG_TOOLS_BUILD_WITH_LIBC_DL
20 LIBS += -lc
21 endif
22
23 LIBTAP=$(top_builddir)/tests/utils/tap/libtap.la
24
25 LIBCOMMON=$(top_builddir)/src/common/libcommon.la
26 LIBSESSIOND_COMM=$(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
27 LIBHASHTABLE=$(top_builddir)/src/common/hashtable/libhashtable.la
28 LIBRELAYD=$(top_builddir)/src/common/relayd/librelayd.la
29
30 # Define test programs
31 noinst_PROGRAMS = test_uri test_session test_kernel_data
32 noinst_PROGRAMS += test_utils_parse_size_suffix test_utils_expand_path
33
34 if HAVE_LIBLTTNG_UST_CTL
35 noinst_PROGRAMS += test_ust_data
36 TESTS += test_ust_data
37 endif
38
39 # URI unit tests
40 test_uri_SOURCES = test_uri.c
41 test_uri_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBHASHTABLE)
42
43 # Session unit test
44 SESSIONS=$(top_builddir)/src/bin/lttng-sessiond/session.o \
45 $(top_builddir)/src/bin/lttng-sessiond/consumer.o \
46 $(top_builddir)/src/bin/lttng-sessiond/utils.o \
47 $(top_builddir)/src/bin/lttng-sessiond/snapshot.o \
48 $(top_builddir)/src/common/uri.o \
49 $(top_builddir)/src/common/utils.o \
50 $(top_builddir)/src/common/error.o \
51 $(top_builddir)/src/common/health/libhealth.la \
52 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
53
54
55 test_session_SOURCES = test_session.c
56 test_session_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
57 $(LIBHASHTABLE) -lrt
58 test_session_LDADD += $(SESSIONS)
59
60 # UST data structures unit test
61 if HAVE_LIBLTTNG_UST_CTL
62 UST_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-ust.o \
63 $(top_builddir)/src/bin/lttng-sessiond/consumer.o \
64 $(top_builddir)/src/bin/lttng-sessiond/utils.o \
65 $(top_builddir)/src/bin/lttng-sessiond/buffer-registry.o \
66 $(top_builddir)/src/bin/lttng-sessiond/ust-registry.o \
67 $(top_builddir)/src/bin/lttng-sessiond/ust-metadata.o \
68 $(top_builddir)/src/bin/lttng-sessiond/ust-app.o \
69 $(top_builddir)/src/bin/lttng-sessiond/ust-consumer.o \
70 $(top_builddir)/src/bin/lttng-sessiond/fd-limit.o \
71 $(top_builddir)/src/bin/lttng-sessiond/session.o \
72 $(top_builddir)/src/bin/lttng-sessiond/snapshot.o \
73 $(top_builddir)/src/bin/lttng-sessiond/agent.o \
74 $(top_builddir)/src/common/uri.o \
75 $(top_builddir)/src/common/utils.o \
76 $(top_builddir)/src/common/health/libhealth.la \
77 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
78
79 test_ust_data_SOURCES = test_ust_data.c
80 test_ust_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM)\
81 $(LIBHASHTABLE) -lrt -llttng-ust-ctl
82 test_ust_data_LDADD += $(UST_DATA_TRACE)
83 endif
84
85 # Kernel data structures unit test
86 KERN_DATA_TRACE=$(top_builddir)/src/bin/lttng-sessiond/trace-kernel.o \
87 $(top_builddir)/src/bin/lttng-sessiond/consumer.o \
88 $(top_builddir)/src/bin/lttng-sessiond/utils.o \
89 $(top_builddir)/src/common/uri.o \
90 $(top_builddir)/src/common/utils.o \
91 $(top_builddir)/src/common/health/libhealth.la \
92 $(top_builddir)/src/common/sessiond-comm/libsessiond-comm.la
93
94 test_kernel_data_SOURCES = test_kernel_data.c
95 test_kernel_data_LDADD = $(LIBTAP) $(LIBCOMMON) $(LIBRELAYD) $(LIBSESSIOND_COMM) \
96 $(LIBHASHTABLE) -lrt
97 test_kernel_data_LDADD += $(KERN_DATA_TRACE)
98
99 # utils suffix for unit test
100 UTILS_SUFFIX=$(top_builddir)/src/common/utils.o \
101 $(top_builddir)/src/common/runas.o
102
103 # parse_size_suffix unit test
104 test_utils_parse_size_suffix_SOURCES = test_utils_parse_size_suffix.c
105 test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
106 test_utils_parse_size_suffix_LDADD += $(UTILS_SUFFIX)
107
108 # expand_path unit test
109 test_utils_expand_path_SOURCES = test_utils_expand_path.c
110 test_utils_expand_path_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
111 test_utils_expand_path_LDADD += $(UTILS_SUFFIX)
This page took 0.043272 seconds and 4 git commands to generate.