1 EXTRA_DIST = \
2 coverage.sh \
3 testwrapper.sh \
4 integration/config.sh \
5 integration/ssl.sh \
6 integration/query.sh \
7 integration/matching.sh \
8 integration/filter.sh \
9 integration/test_lib.sh \
10 valgrind.suppress
12 # coverage related flags are only set when gcov is enabled
13 AM_CFLAGS = @STRICT_CFLAGS@ @COVERAGE_CFLAGS@
14 AM_LDFLAGS = @COVERAGE_LDFLAGS@
15 AM_CPPFLAGS = -I$(top_srcdir)/src/include
17 TESTS =
18 check_PROGRAMS =
19 check_LTLIBRARIES =
21 #
22 # unit tests
23 #
25 LOG_COMPILER = $(abs_srcdir)/testwrapper.sh
27 if UNIT_TESTING
28 UNIT_TESTS = \
29 unit/core/data_test \
30 unit/core/object_test \
31 unit/core/store_expr_test \
32 unit/core/store_json_test \
33 unit/core/store_lookup_test \
34 unit/core/store_test \
35 unit/core/time_test \
36 unit/frontend/connection_test \
37 unit/frontend/parser_test \
38 unit/frontend/query_test \
39 unit/frontend/sock_test \
40 unit/utils/avltree_test \
41 unit/utils/channel_test \
42 unit/utils/dbi_test \
43 unit/utils/llist_test \
44 unit/utils/os_test \
45 unit/utils/proto_test \
46 unit/utils/strbuf_test
48 UNIT_TEST_SOURCES = unit/testutils.c unit/testutils.h
49 UNIT_TEST_CFLAGS = $(AM_CFLAGS) @CHECK_CFLAGS@ -I$(top_srcdir)/t/unit
50 UNIT_TEST_LDADD = $(top_builddir)/src/libsysdb.la @CHECK_LIBS@
52 if BUILD_WITH_FOPENCOOKIE
53 UNIT_TESTS += unit/utils/unixsock_test
54 unit_utils_unixsock_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/unixsock_test.c
55 unit_utils_unixsock_test_CFLAGS = $(UNIT_TEST_CFLAGS)
56 unit_utils_unixsock_test_LDADD = $(UNIT_TEST_LDADD)
57 endif
59 unit_core_data_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/data_test.c
60 unit_core_data_test_CFLAGS = $(UNIT_TEST_CFLAGS)
61 unit_core_data_test_LDADD = $(UNIT_TEST_LDADD)
63 unit_core_object_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/object_test.c
64 unit_core_object_test_CFLAGS = $(UNIT_TEST_CFLAGS)
65 unit_core_object_test_LDADD = $(UNIT_TEST_LDADD)
67 unit_core_store_expr_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_expr_test.c
68 unit_core_store_expr_test_CFLAGS = $(UNIT_TEST_CFLAGS)
69 unit_core_store_expr_test_LDADD = $(UNIT_TEST_LDADD)
71 unit_core_store_json_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_json_test.c
72 unit_core_store_json_test_CFLAGS = $(UNIT_TEST_CFLAGS)
73 unit_core_store_json_test_LDADD = $(UNIT_TEST_LDADD)
75 unit_core_store_lookup_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_lookup_test.c
76 unit_core_store_lookup_test_CFLAGS = $(UNIT_TEST_CFLAGS)
77 unit_core_store_lookup_test_LDADD = $(UNIT_TEST_LDADD)
79 unit_core_store_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_test.c
80 unit_core_store_test_CFLAGS = $(UNIT_TEST_CFLAGS)
81 unit_core_store_test_LDADD = $(UNIT_TEST_LDADD)
83 unit_core_time_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/time_test.c
84 unit_core_time_test_CFLAGS = $(UNIT_TEST_CFLAGS)
85 unit_core_time_test_LDADD = $(UNIT_TEST_LDADD)
87 unit_frontend_connection_test_SOURCES = $(UNIT_TEST_SOURCES) unit/frontend/connection_test.c
88 unit_frontend_connection_test_CFLAGS = $(UNIT_TEST_CFLAGS)
89 unit_frontend_connection_test_LDADD = $(UNIT_TEST_LDADD)
91 unit_frontend_parser_test_SOURCES = $(UNIT_TEST_SOURCES) unit/frontend/parser_test.c
92 unit_frontend_parser_test_CFLAGS = $(UNIT_TEST_CFLAGS)
93 unit_frontend_parser_test_LDADD = $(UNIT_TEST_LDADD)
95 unit_frontend_query_test_SOURCES = $(UNIT_TEST_SOURCES) unit/frontend/query_test.c
96 unit_frontend_query_test_CFLAGS = $(UNIT_TEST_CFLAGS)
97 unit_frontend_query_test_LDADD = $(UNIT_TEST_LDADD)
99 unit_frontend_sock_test_SOURCES = $(UNIT_TEST_SOURCES) unit/frontend/sock_test.c
100 unit_frontend_sock_test_CFLAGS = $(UNIT_TEST_CFLAGS)
101 unit_frontend_sock_test_LDADD = $(UNIT_TEST_LDADD)
103 unit_utils_avltree_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/avltree_test.c
104 unit_utils_avltree_test_CFLAGS = $(UNIT_TEST_CFLAGS)
105 unit_utils_avltree_test_LDADD = $(UNIT_TEST_LDADD)
107 unit_utils_channel_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/channel_test.c
108 unit_utils_channel_test_CFLAGS = $(UNIT_TEST_CFLAGS)
109 unit_utils_channel_test_LDADD = $(UNIT_TEST_LDADD)
111 unit_utils_dbi_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/dbi_test.c
112 unit_utils_dbi_test_CFLAGS = $(UNIT_TEST_CFLAGS)
113 unit_utils_dbi_test_LDADD = $(UNIT_TEST_LDADD)
115 unit_utils_llist_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/llist_test.c
116 unit_utils_llist_test_CFLAGS = $(UNIT_TEST_CFLAGS)
117 unit_utils_llist_test_LDADD = $(UNIT_TEST_LDADD)
119 unit_utils_os_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/os_test.c
120 unit_utils_os_test_CFLAGS = $(UNIT_TEST_CFLAGS)
121 unit_utils_os_test_LDADD = $(UNIT_TEST_LDADD)
123 unit_utils_proto_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/proto_test.c
124 unit_utils_proto_test_CFLAGS = $(UNIT_TEST_CFLAGS)
125 unit_utils_proto_test_LDADD = $(UNIT_TEST_LDADD)
127 unit_utils_strbuf_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/strbuf_test.c
128 unit_utils_strbuf_test_CFLAGS = $(UNIT_TEST_CFLAGS)
129 unit_utils_strbuf_test_LDADD = $(UNIT_TEST_LDADD)
131 TESTS += $(UNIT_TESTS)
132 check_PROGRAMS += $(UNIT_TESTS)
133 endif
135 #
136 # integration tests
137 #
139 if INTEGRATION_TESTING
140 INTEGRATION_TESTS = \
141 integration/client.sh \
142 integration/config.sh \
143 integration/ssl.sh \
144 integration/query_fetch.sh \
145 integration/query_list.sh \
146 integration/query_timeseries.sh \
147 integration/matching.sh \
148 integration/filter.sh
150 TESTS += $(INTEGRATION_TESTS)
152 check_LTLIBRARIES += integration/mock_plugin.la
153 integration_mock_plugin_la_SOURCES = integration/mock_plugin.c
154 # -rpath is a work-around to enforce a shared library
155 integration_mock_plugin_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
156 -rpath /nonexistent
158 check_LTLIBRARIES += integration/mock_timeseries.la
159 integration_mock_timeseries_la_SOURCES = integration/mock_timeseries.c
160 # -rpath is a work-around to enforce a shared library
161 integration_mock_timeseries_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
162 -rpath /nonexistent
163 endif
165 test: check