ovsdb: Add support for referential integrity in the database itself.
[sliver-openvswitch.git] / tests / automake.mk
1 EXTRA_DIST += \
2         $(TESTSUITE_AT) \
3         $(TESTSUITE) \
4         tests/atlocal.in \
5         $(srcdir)/package.m4 \
6         $(srcdir)/tests/testsuite
7 TESTSUITE_AT = \
8         tests/testsuite.at \
9         tests/ovsdb-macros.at \
10         tests/library.at \
11         tests/check-structs.at \
12         tests/daemon.at \
13         tests/vconn.at \
14         tests/dir_name.at \
15         tests/aes128.at \
16         tests/uuid.at \
17         tests/json.at \
18         tests/jsonrpc.at \
19         tests/timeval.at \
20         tests/lockfile.at \
21         tests/reconnect.at \
22         tests/ovsdb.at \
23         tests/ovsdb-log.at \
24         tests/ovsdb-types.at \
25         tests/ovsdb-data.at \
26         tests/ovsdb-column.at \
27         tests/ovsdb-table.at \
28         tests/ovsdb-row.at \
29         tests/ovsdb-schema.at \
30         tests/ovsdb-condition.at \
31         tests/ovsdb-mutation.at \
32         tests/ovsdb-query.at \
33         tests/ovsdb-transaction.at \
34         tests/ovsdb-execution.at \
35         tests/ovsdb-trigger.at \
36         tests/ovsdb-file.at \
37         tests/ovsdb-server.at \
38         tests/ovsdb-monitor.at \
39         tests/ovsdb-idl.at \
40         tests/stp.at \
41         tests/ovs-vsctl.at
42 TESTSUITE = $(srcdir)/tests/testsuite
43 DISTCLEANFILES += tests/atconfig tests/atlocal $(TESTSUITE)
44
45 AUTOTEST_PATH = utilities:vswitchd:ovsdb:tests
46
47 check-local: tests/atconfig tests/atlocal $(TESTSUITE)
48         $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
49 \f
50 # lcov support
51
52 lcov_wrappers = \
53         tests/lcov/ovs-appctl \
54         tests/lcov/ovs-vsctl \
55         tests/lcov/ovsdb-client \
56         tests/lcov/ovsdb-server \
57         tests/lcov/ovsdb-tool \
58         tests/lcov/test-aes128 \
59         tests/lcov/test-classifier \
60         tests/lcov/test-csum \
61         tests/lcov/test-dhcp-client \
62         tests/lcov/test-dir_name \
63         tests/lcov/test-flows \
64         tests/lcov/test-hash \
65         tests/lcov/test-hmap \
66         tests/lcov/test-json \
67         tests/lcov/test-jsonrpc \
68         tests/lcov/test-list \
69         tests/lcov/test-lockfile \
70         tests/lcov/test-ovsdb \
71         tests/lcov/test-reconnect \
72         tests/lcov/test-sha1 \
73         tests/lcov/test-stp \
74         tests/lcov/test-timeval \
75         tests/lcov/test-type-props \
76         tests/lcov/test-uuid \
77         tests/lcov/test-vconn
78
79 $(lcov_wrappers): tests/lcov-wrapper.in
80         @test -d tests/lcov || mkdir tests/lcov
81         sed -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),' \
82             -e 's,[@]wrap_program[@],$@,' \
83                 $(top_srcdir)/tests/lcov-wrapper.in > $@.tmp
84         chmod +x $@.tmp
85         mv $@.tmp $@
86 CLEANFILES += $(lcov_wrappers)
87 EXTRA_DIST += tests/lcov-wrapper.in
88
89 LCOV = lcov -b $(abs_top_builddir) -d $(abs_top_builddir) -q
90 check-lcov: all tests/atconfig tests/atlocal $(TESTSUITE) $(lcov_wrappers)
91         rm -fr tests/coverage.html tests/coverage.info
92         $(LCOV) -c -i -o - > tests/coverage.info
93         $(SHELL) '$(TESTSUITE)' -C tests CHECK_LCOV=true AUTOTEST_PATH='tests/lcov:$(AUTOTEST_PATH)' $(TESTSUITEFLAGS); \
94                 rc=$$?; \
95                 echo "Producing coverage.html..."; \
96                 cd tests && genhtml -q -o coverage.html coverage.info; \
97                 exit $$rc
98 \f
99 # valgrind support
100
101 valgrind_wrappers = \
102         tests/valgrind/ovs-appctl \
103         tests/valgrind/ovs-vsctl \
104         tests/valgrind/ovsdb-client \
105         tests/valgrind/ovsdb-server \
106         tests/valgrind/ovsdb-tool \
107         tests/valgrind/test-aes128 \
108         tests/valgrind/test-classifier \
109         tests/valgrind/test-csum \
110         tests/valgrind/test-dhcp-client \
111         tests/valgrind/test-dir_name \
112         tests/valgrind/test-flows \
113         tests/valgrind/test-hash \
114         tests/valgrind/test-hmap \
115         tests/valgrind/test-json \
116         tests/valgrind/test-jsonrpc \
117         tests/valgrind/test-list \
118         tests/valgrind/test-lockfile \
119         tests/valgrind/test-ovsdb \
120         tests/valgrind/test-reconnect \
121         tests/valgrind/test-sha1 \
122         tests/valgrind/test-stp \
123         tests/valgrind/test-timeval \
124         tests/valgrind/test-type-props \
125         tests/valgrind/test-uuid \
126         tests/valgrind/test-vconn
127
128 $(valgrind_wrappers): tests/valgrind-wrapper.in
129         @test -d tests/valgrind || mkdir tests/valgrind
130         sed -e 's,[@]wrap_program[@],$@,' \
131                 $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp
132         chmod +x $@.tmp
133         mv $@.tmp $@
134 CLEANFILES += $(valgrind_wrappers)
135 EXTRA_DIST += tests/valgrind-wrapper.in
136
137 VALGRIND = valgrind --log-file=valgrind.%p --leak-check=full \
138         --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
139 EXTRA_DIST += tests/openssl.supp
140 check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) $(valgrind_wrappers)
141         $(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
142         @echo
143         @echo '----------------------------------------------------------------------'
144         @echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'
145         @echo '----------------------------------------------------------------------'
146 \f
147 clean-local:
148         test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
149
150 AUTOM4TE = autom4te
151 AUTOTEST = $(AUTOM4TE) --language=autotest
152 $(TESTSUITE): package.m4 $(TESTSUITE_AT)
153         $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
154         mv $@.tmp $@
155
156 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
157 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
158         :;{ \
159           echo '# Signature of the current package.' && \
160           echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])' && \
161           echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])' && \
162           echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])' && \
163           echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])' && \
164           echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
165         } >'$(srcdir)/package.m4'
166
167 noinst_PROGRAMS += tests/test-aes128
168 tests_test_aes128_SOURCES = tests/test-aes128.c
169 tests_test_aes128_LDADD = lib/libopenvswitch.a
170
171 noinst_PROGRAMS += tests/test-classifier
172 tests_test_classifier_SOURCES = tests/test-classifier.c
173 tests_test_classifier_LDADD = lib/libopenvswitch.a
174
175 noinst_PROGRAMS += tests/test-csum
176 tests_test_csum_SOURCES = tests/test-csum.c
177 tests_test_csum_LDADD = lib/libopenvswitch.a
178
179 noinst_PROGRAMS += tests/test-dir_name
180 tests_test_dir_name_SOURCES = tests/test-dir_name.c
181 tests_test_dir_name_LDADD = lib/libopenvswitch.a
182
183 noinst_PROGRAMS += tests/test-flows
184 tests_test_flows_SOURCES = tests/test-flows.c
185 tests_test_flows_LDADD = lib/libopenvswitch.a
186 dist_check_SCRIPTS = tests/flowgen.pl
187
188 noinst_PROGRAMS += tests/test-hash
189 tests_test_hash_SOURCES = tests/test-hash.c
190 tests_test_hash_LDADD = lib/libopenvswitch.a
191
192 noinst_PROGRAMS += tests/test-hmap
193 tests_test_hmap_SOURCES = tests/test-hmap.c
194 tests_test_hmap_LDADD = lib/libopenvswitch.a
195
196 noinst_PROGRAMS += tests/test-json
197 tests_test_json_SOURCES = tests/test-json.c
198 tests_test_json_LDADD = lib/libopenvswitch.a
199
200 noinst_PROGRAMS += tests/test-jsonrpc
201 tests_test_jsonrpc_SOURCES = tests/test-jsonrpc.c
202 tests_test_jsonrpc_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
203
204 noinst_PROGRAMS += tests/test-list
205 tests_test_list_SOURCES = tests/test-list.c
206 tests_test_list_LDADD = lib/libopenvswitch.a
207
208 noinst_PROGRAMS += tests/test-lockfile
209 tests_test_lockfile_SOURCES = tests/test-lockfile.c
210 tests_test_lockfile_LDADD = lib/libopenvswitch.a
211
212 noinst_PROGRAMS += tests/test-ovsdb
213 tests_test_ovsdb_SOURCES = \
214         tests/test-ovsdb.c \
215         tests/idltest.c \
216         tests/idltest.h
217 EXTRA_DIST += tests/uuidfilt.pl
218 tests_test_ovsdb_LDADD = ovsdb/libovsdb.a lib/libopenvswitch.a $(SSL_LIBS) $(PCRE_LIBS)
219
220 # idltest schema and IDL
221 OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
222 IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
223 EXTRA_DIST += $(IDLTEST_IDL_FILES)
224 tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
225         $(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp
226         mv $@.tmp $@
227
228 tests/idltest.c: tests/idltest.h
229
230 noinst_PROGRAMS += tests/test-reconnect
231 tests_test_reconnect_SOURCES = tests/test-reconnect.c
232 tests_test_reconnect_LDADD = lib/libopenvswitch.a
233
234 noinst_PROGRAMS += tests/test-sha1
235 tests_test_sha1_SOURCES = tests/test-sha1.c
236 tests_test_sha1_LDADD = lib/libopenvswitch.a
237
238 noinst_PROGRAMS += tests/test-timeval
239 tests_test_timeval_SOURCES = tests/test-timeval.c
240 tests_test_timeval_LDADD = lib/libopenvswitch.a
241
242 noinst_PROGRAMS += tests/test-strtok_r
243 tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
244
245 noinst_PROGRAMS += tests/test-type-props
246 tests_test_type_props_SOURCES = tests/test-type-props.c
247
248 noinst_PROGRAMS += tests/test-dhcp-client
249 tests_test_dhcp_client_SOURCES = tests/test-dhcp-client.c
250 tests_test_dhcp_client_LDADD = lib/libopenvswitch.a
251
252 noinst_PROGRAMS += tests/test-stp
253 tests_test_stp_SOURCES = tests/test-stp.c
254 tests_test_stp_LDADD = lib/libopenvswitch.a
255
256 noinst_PROGRAMS += tests/test-uuid
257 tests_test_uuid_SOURCES = tests/test-uuid.c
258 tests_test_uuid_LDADD = lib/libopenvswitch.a
259
260 noinst_PROGRAMS += tests/test-vconn
261 tests_test_vconn_SOURCES = tests/test-vconn.c
262 tests_test_vconn_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
263 EXTRA_DIST += \
264         tests/testpki-cacert.pem \
265         tests/testpki-cert.pem \
266         tests/testpki-cert2.pem \
267         tests/testpki-privkey.pem \
268         tests/testpki-privkey2.pem \
269         tests/testpki-req.pem \
270         tests/testpki-req2.pem