Code

039995cdc3fde350004d564c143544a6410aec1e
[sysdb.git] / t / Makefile.am
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_builddir)/src/include \
16                 -I$(top_srcdir)/src/include -I$(top_srcdir)/src
18 TESTS =
19 check_PROGRAMS =
20 check_LTLIBRARIES =
22 #
23 # unit tests
24 #
26 LOG_COMPILER = env VPATH=$(VPATH) $(abs_srcdir)/testwrapper.sh
28 if UNIT_TESTING
29 UNIT_TESTS = \
30                 unit/core/data_test \
31                 unit/core/object_test \
32                 unit/core/store_expr_test \
33                 unit/core/store_json_test \
34                 unit/core/store_lookup_test \
35                 unit/core/store_test \
36                 unit/core/time_test \
37                 unit/frontend/connection_test \
38                 unit/frontend/parser_test \
39                 unit/frontend/query_test \
40                 unit/frontend/sock_test \
41                 unit/utils/avltree_test \
42                 unit/utils/channel_test \
43                 unit/utils/dbi_test \
44                 unit/utils/llist_test \
45                 unit/utils/os_test \
46                 unit/utils/proto_test \
47                 unit/utils/strbuf_test
49 UNIT_TEST_SOURCES = unit/testutils.c unit/testutils.h
50 UNIT_TEST_CFLAGS = $(AM_CFLAGS) @CHECK_CFLAGS@ -I$(top_srcdir)/t/unit
51 UNIT_TEST_LDADD = $(top_builddir)/src/libsysdb.la @CHECK_LIBS@
53 if BUILD_WITH_FOPENCOOKIE
54 UNIT_TESTS += unit/utils/unixsock_test
55 unit_utils_unixsock_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/unixsock_test.c
56 unit_utils_unixsock_test_CFLAGS = $(UNIT_TEST_CFLAGS)
57 unit_utils_unixsock_test_LDADD = $(UNIT_TEST_LDADD)
58 endif
60 unit_core_data_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/data_test.c
61 unit_core_data_test_CFLAGS = $(UNIT_TEST_CFLAGS)
62 unit_core_data_test_LDADD = $(UNIT_TEST_LDADD)
64 unit_core_object_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/object_test.c
65 unit_core_object_test_CFLAGS = $(UNIT_TEST_CFLAGS)
66 unit_core_object_test_LDADD = $(UNIT_TEST_LDADD)
68 unit_core_store_expr_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_expr_test.c
69 unit_core_store_expr_test_CFLAGS = $(UNIT_TEST_CFLAGS)
70 unit_core_store_expr_test_LDADD = $(UNIT_TEST_LDADD)
72 unit_core_store_json_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_json_test.c
73 unit_core_store_json_test_CFLAGS = $(UNIT_TEST_CFLAGS)
74 unit_core_store_json_test_LDADD = $(UNIT_TEST_LDADD)
76 unit_core_store_lookup_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_lookup_test.c
77 unit_core_store_lookup_test_CFLAGS = $(UNIT_TEST_CFLAGS)
78 unit_core_store_lookup_test_LDADD = $(UNIT_TEST_LDADD)
80 unit_core_store_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/store_test.c
81 unit_core_store_test_CFLAGS = $(UNIT_TEST_CFLAGS)
82 unit_core_store_test_LDADD = $(UNIT_TEST_LDADD)
84 unit_core_time_test_SOURCES = $(UNIT_TEST_SOURCES) unit/core/time_test.c
85 unit_core_time_test_CFLAGS = $(UNIT_TEST_CFLAGS)
86 unit_core_time_test_LDADD = $(UNIT_TEST_LDADD)
88 unit_frontend_connection_test_SOURCES = $(UNIT_TEST_SOURCES) unit/frontend/connection_test.c
89 unit_frontend_connection_test_CFLAGS = $(UNIT_TEST_CFLAGS)
90 unit_frontend_connection_test_LDADD = $(UNIT_TEST_LDADD)
92 unit_frontend_parser_test_SOURCES = $(UNIT_TEST_SOURCES) unit/frontend/parser_test.c
93 unit_frontend_parser_test_CFLAGS = $(UNIT_TEST_CFLAGS)
94 unit_frontend_parser_test_LDADD = $(UNIT_TEST_LDADD)
96 unit_frontend_query_test_SOURCES = $(UNIT_TEST_SOURCES) unit/frontend/query_test.c
97 unit_frontend_query_test_CFLAGS = $(UNIT_TEST_CFLAGS)
98 unit_frontend_query_test_LDADD = $(UNIT_TEST_LDADD)
100 unit_frontend_sock_test_SOURCES = $(UNIT_TEST_SOURCES) unit/frontend/sock_test.c
101 unit_frontend_sock_test_CFLAGS = $(UNIT_TEST_CFLAGS)
102 unit_frontend_sock_test_LDADD = $(UNIT_TEST_LDADD)
104 unit_utils_avltree_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/avltree_test.c
105 unit_utils_avltree_test_CFLAGS = $(UNIT_TEST_CFLAGS)
106 unit_utils_avltree_test_LDADD = $(UNIT_TEST_LDADD)
108 unit_utils_channel_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/channel_test.c
109 unit_utils_channel_test_CFLAGS = $(UNIT_TEST_CFLAGS)
110 unit_utils_channel_test_LDADD = $(UNIT_TEST_LDADD)
112 unit_utils_dbi_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/dbi_test.c
113 unit_utils_dbi_test_CFLAGS = $(UNIT_TEST_CFLAGS)
114 unit_utils_dbi_test_LDADD = $(UNIT_TEST_LDADD)
116 unit_utils_llist_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/llist_test.c
117 unit_utils_llist_test_CFLAGS = $(UNIT_TEST_CFLAGS)
118 unit_utils_llist_test_LDADD = $(UNIT_TEST_LDADD)
120 unit_utils_os_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/os_test.c
121 unit_utils_os_test_CFLAGS = $(UNIT_TEST_CFLAGS)
122 unit_utils_os_test_LDADD = $(UNIT_TEST_LDADD)
124 unit_utils_proto_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/proto_test.c
125 unit_utils_proto_test_CFLAGS = $(UNIT_TEST_CFLAGS)
126 unit_utils_proto_test_LDADD = $(UNIT_TEST_LDADD)
128 unit_utils_strbuf_test_SOURCES = $(UNIT_TEST_SOURCES) unit/utils/strbuf_test.c
129 unit_utils_strbuf_test_CFLAGS = $(UNIT_TEST_CFLAGS)
130 unit_utils_strbuf_test_LDADD = $(UNIT_TEST_LDADD)
132 TESTS += $(UNIT_TESTS)
133 check_PROGRAMS += $(UNIT_TESTS)
134 endif
137 # integration tests
140 if INTEGRATION_TESTING
141 INTEGRATION_TESTS = \
142                 integration/client.sh \
143                 integration/config.sh \
144                 integration/ssl.sh \
145                 integration/query_fetch.sh \
146                 integration/query_list.sh \
147                 integration/query_timeseries.sh \
148                 integration/matching.sh \
149                 integration/filter.sh
151 TESTS += $(INTEGRATION_TESTS)
153 check_LTLIBRARIES += integration/mock_plugin.la
154 integration_mock_plugin_la_SOURCES = integration/mock_plugin.c
155 # -rpath is a work-around to enforce a shared library
156 integration_mock_plugin_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
157                 -rpath /nonexistent
159 check_LTLIBRARIES += integration/mock_timeseries.la
160 integration_mock_timeseries_la_SOURCES = integration/mock_timeseries.c
161 # -rpath is a work-around to enforce a shared library
162 integration_mock_timeseries_la_LDFLAGS = $(AM_LDFLAGS) -module -avoid-version \
163                 -rpath /nonexistent
164 endif
166 test: check