1 EXTRA_DIST = \
2 coverage.sh \
3 testwrapper.sh \
4 integration/client.sh \
5 integration/config.sh \
6 integration/ssl.sh \
7 integration/store.sh \
8 integration/query_fetch.sh \
9 integration/query_list.sh \
10 integration/query_timeseries.sh \
11 integration/matching.sh \
12 integration/filter.sh \
13 integration/test_lib.sh \
14 valgrind.suppress
16 # coverage related flags are only set when gcov is enabled
17 AM_CFLAGS = @STRICT_CFLAGS@ @COVERAGE_CFLAGS@
18 AM_LDFLAGS = @COVERAGE_LDFLAGS@
19 AM_CPPFLAGS = -I$(top_builddir)/src/include \
20 -I$(top_srcdir)/src/include -I$(top_srcdir)/src
22 TESTS =
23 check_PROGRAMS =
24 check_LTLIBRARIES =
26 #
27 # unit tests
28 #
30 LOG_COMPILER = env VPATH=$(VPATH) $(abs_srcdir)/testwrapper.sh
32 if UNIT_TESTING
33 UNIT_TESTS = \
34 unit/core/data_test \
35 unit/core/object_test \
36 unit/core/store_expr_test \
37 unit/core/store_json_test \
38 unit/core/store_lookup_test \
39 unit/core/store_test \
40 unit/core/time_test \
41 unit/frontend/connection_test \
42 unit/frontend/query_test \
43 unit/frontend/sock_test \
44 unit/parser/ast_test \
45 unit/parser/ast_test \
46 unit/parser/parser_test \
47 unit/utils/avltree_test \
48 unit/utils/channel_test \
49 unit/utils/dbi_test \
50 unit/utils/llist_test \
51 unit/utils/os_test \
52 unit/utils/proto_test \
53 unit/utils/strbuf_test
55 UNIT_TEST_SOURCES = unit/testutils.c unit/testutils.h
56 UNIT_TEST_CFLAGS = $(AM_CFLAGS) @CHECK_CFLAGS@ -I$(top_srcdir)/t/unit
57 UNIT_TEST_LDADD = $(top_builddir)/src/libsysdb.la @CHECK_LIBS@
59 if BUILD_WITH_FOPENCOOKIE
60 UNIT_TESTS += unit/utils/unixsock_test
61 unit_utils_unixsock_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/unixsock_test.c
62 unit_utils_unixsock_test_CFLAGS = $(UNIT_TEST_CFLAGS)
63 unit_utils_unixsock_test_LDADD = $(UNIT_TEST_LDADD)
64 endif
66 unit_core_data_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/data_test.c
67 unit_core_data_test_CFLAGS = $(UNIT_TEST_CFLAGS)
68 unit_core_data_test_LDADD = $(UNIT_TEST_LDADD)
70 unit_core_object_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/object_test.c
71 unit_core_object_test_CFLAGS = $(UNIT_TEST_CFLAGS)
72 unit_core_object_test_LDADD = $(UNIT_TEST_LDADD)
74 unit_core_store_expr_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_expr_test.c
75 unit_core_store_expr_test_CFLAGS = $(UNIT_TEST_CFLAGS)
76 unit_core_store_expr_test_LDADD = $(UNIT_TEST_LDADD)
78 unit_core_store_json_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_json_test.c
79 unit_core_store_json_test_CFLAGS = $(UNIT_TEST_CFLAGS)
80 unit_core_store_json_test_LDADD = $(UNIT_TEST_LDADD)
82 unit_core_store_lookup_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_lookup_test.c
83 unit_core_store_lookup_test_CFLAGS = $(UNIT_TEST_CFLAGS)
84 unit_core_store_lookup_test_LDADD = $(UNIT_TEST_LDADD)
86 unit_core_store_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_test.c
87 unit_core_store_test_CFLAGS = $(UNIT_TEST_CFLAGS)
88 unit_core_store_test_LDADD = $(UNIT_TEST_LDADD)
90 unit_core_time_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/time_test.c
91 unit_core_time_test_CFLAGS = $(UNIT_TEST_CFLAGS)
92 unit_core_time_test_LDADD = $(UNIT_TEST_LDADD)
94 unit_frontend_connection_test_SOURCES = $(UNIT_TEST_SOURCES) unit/frontend/connection_test.c
95 unit_frontend_connection_test_CFLAGS = $(UNIT_TEST_CFLAGS)
96 unit_frontend_connection_test_LDADD = $(UNIT_TEST_LDADD)
98 unit_frontend_query_test_SOURCES = $(UNIT_TEST_SOURCES) unit/frontend/query_test.c
99 unit_frontend_query_test_CFLAGS = $(UNIT_TEST_CFLAGS)
100 unit_frontend_query_test_LDADD = $(UNIT_TEST_LDADD)
102 unit_frontend_sock_test_SOURCES = $(UNIT_TEST_SOURCES) unit/frontend/sock_test.c
103 unit_frontend_sock_test_CFLAGS = $(UNIT_TEST_CFLAGS)
104 unit_frontend_sock_test_LDADD = $(UNIT_TEST_LDADD)
106 unit_parser_ast_test_SOURCES = $(UNIT_TEST_SOURCES) unit/parser/ast_test.c
107 unit_parser_ast_test_CFLAGS = $(UNIT_TEST_CFLAGS)
108 unit_parser_ast_test_LDADD = $(UNIT_TEST_LDADD)
110 unit_parser_parser_test_SOURCES = $(UNIT_TEST_SOURCES) unit/parser/parser_test.c
111 unit_parser_parser_test_CFLAGS = $(UNIT_TEST_CFLAGS)
112 unit_parser_parser_test_LDADD = $(UNIT_TEST_LDADD)
114 unit_utils_avltree_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/avltree_test.c
115 unit_utils_avltree_test_CFLAGS = $(UNIT_TEST_CFLAGS)
116 unit_utils_avltree_test_LDADD = $(UNIT_TEST_LDADD)
118 unit_utils_channel_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/channel_test.c
119 unit_utils_channel_test_CFLAGS = $(UNIT_TEST_CFLAGS)
120 unit_utils_channel_test_LDADD = $(UNIT_TEST_LDADD)
122 unit_utils_dbi_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/dbi_test.c
123 unit_utils_dbi_test_CFLAGS = $(UNIT_TEST_CFLAGS)
124 unit_utils_dbi_test_LDADD = $(UNIT_TEST_LDADD)
126 unit_utils_llist_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/llist_test.c
127 unit_utils_llist_test_CFLAGS = $(UNIT_TEST_CFLAGS)
128 unit_utils_llist_test_LDADD = $(UNIT_TEST_LDADD)
130 unit_utils_os_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/os_test.c
131 unit_utils_os_test_CFLAGS = $(UNIT_TEST_CFLAGS)
132 unit_utils_os_test_LDADD = $(UNIT_TEST_LDADD)
134 unit_utils_proto_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/proto_test.c
135 unit_utils_proto_test_CFLAGS = $(UNIT_TEST_CFLAGS)
136 unit_utils_proto_test_LDADD = $(UNIT_TEST_LDADD)
138 unit_utils_strbuf_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/strbuf_test.c
139 unit_utils_strbuf_test_CFLAGS = $(UNIT_TEST_CFLAGS)
140 unit_utils_strbuf_test_LDADD = $(UNIT_TEST_LDADD)
142 TESTS += $(UNIT_TESTS)
143 check_PROGRAMS += $(UNIT_TESTS)
144 endif
146 #
147 # integration tests
148 #
150 if INTEGRATION_TESTING
151 INTEGRATION_TESTS = \
152 integration/client.sh \
153 integration/config.sh \
154 integration/ssl.sh \
155 integration/store.sh \
156 integration/query_fetch.sh \
157 integration/query_list.sh \
158 integration/query_timeseries.sh \
159 integration/matching.sh \
160 integration/filter.sh
162 TESTS += $(INTEGRATION_TESTS)
164 check_LTLIBRARIES += integration/mock_plugin.la
165 integration_mock_plugin_la_SOURCES = integration/mock_plugin.c
166 # -rpath is a work-around to enforce a shared library
167 integration_mock_plugin_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
168 -rpath /nonexistent
170 check_LTLIBRARIES += integration/mock_timeseries.la
171 integration_mock_timeseries_la_SOURCES = integration/mock_timeseries.c
172 # -rpath is a work-around to enforce a shared library
173 integration_mock_timeseries_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
174 -rpath /nonexistent
175 endif
177 test: check