heap: New library that implements a binary heap-based priority queue.
[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/heap.at \
12         tests/bundle.at \
13         tests/classifier.at \
14         tests/check-structs.at \
15         tests/daemon.at \
16         tests/daemon-py.at \
17         tests/ofp-print.at \
18         tests/ovs-ofctl.at \
19         tests/odp.at \
20         tests/multipath.at \
21         tests/autopath.at \
22         tests/lacp.at \
23         tests/learn.at \
24         tests/vconn.at \
25         tests/file_name.at \
26         tests/aes128.at \
27         tests/uuid.at \
28         tests/json.at \
29         tests/jsonrpc.at \
30         tests/jsonrpc-py.at \
31         tests/timeval.at \
32         tests/lockfile.at \
33         tests/reconnect.at \
34         tests/ofproto-dpif.at \
35         tests/ofproto-macros.at \
36         tests/ofproto.at \
37         tests/ovsdb.at \
38         tests/ovsdb-log.at \
39         tests/ovsdb-types.at \
40         tests/ovsdb-data.at \
41         tests/ovsdb-column.at \
42         tests/ovsdb-table.at \
43         tests/ovsdb-row.at \
44         tests/ovsdb-schema.at \
45         tests/ovsdb-condition.at \
46         tests/ovsdb-mutation.at \
47         tests/ovsdb-query.at \
48         tests/ovsdb-transaction.at \
49         tests/ovsdb-execution.at \
50         tests/ovsdb-trigger.at \
51         tests/ovsdb-tool.at \
52         tests/ovsdb-server.at \
53         tests/ovsdb-monitor.at \
54         tests/ovsdb-idl.at \
55         tests/ovs-vsctl.at \
56         tests/ovs-monitor-ipsec.at \
57         tests/ovs-xapi-sync.at \
58         tests/stp.at \
59         tests/interface-reconfigure.at \
60         tests/vlog.at
61 TESTSUITE = $(srcdir)/tests/testsuite
62 DISTCLEANFILES += tests/atconfig tests/atlocal
63
64 AUTOTEST_PATH = utilities:vswitchd:ovsdb:tests
65
66 check-local: tests/atconfig tests/atlocal $(TESTSUITE)
67         $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
68 \f
69 # lcov support
70
71 lcov_wrappers = \
72         tests/lcov/ovs-appctl \
73         tests/lcov/ovs-vsctl \
74         tests/lcov/ovs-vswitchd \
75         tests/lcov/ovsdb-client \
76         tests/lcov/ovsdb-server \
77         tests/lcov/ovsdb-tool \
78         tests/lcov/test-aes128 \
79         tests/lcov/test-bundle \
80         tests/lcov/test-byte-order \
81         tests/lcov/test-classifier \
82         tests/lcov/test-csum \
83         tests/lcov/test-file_name \
84         tests/lcov/test-flows \
85         tests/lcov/test-hash \
86         tests/lcov/test-heap \
87         tests/lcov/test-hmap \
88         tests/lcov/test-json \
89         tests/lcov/test-jsonrpc \
90         tests/lcov/test-list \
91         tests/lcov/test-lockfile \
92         tests/lcov/test-multipath \
93         tests/lcov/test-odp \
94         tests/lcov/test-ovsdb \
95         tests/lcov/test-packets \
96         tests/lcov/test-random \
97         tests/lcov/test-reconnect \
98         tests/lcov/test-sha1 \
99         tests/lcov/test-stp \
100         tests/lcov/test-timeval \
101         tests/lcov/test-type-props \
102         tests/lcov/test-unix-socket \
103         tests/lcov/test-uuid \
104         tests/lcov/test-vconn
105
106 $(lcov_wrappers): tests/lcov-wrapper.in
107         @test -d tests/lcov || mkdir tests/lcov
108         sed -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),' \
109             -e 's,[@]wrap_program[@],$@,' \
110                 $(top_srcdir)/tests/lcov-wrapper.in > $@.tmp
111         chmod +x $@.tmp
112         mv $@.tmp $@
113 CLEANFILES += $(lcov_wrappers)
114 EXTRA_DIST += tests/lcov-wrapper.in
115
116 LCOV = lcov -b $(abs_top_builddir) -d $(abs_top_builddir) -q
117 check-lcov: all tests/atconfig tests/atlocal $(TESTSUITE) $(lcov_wrappers)
118         rm -fr tests/coverage.html tests/coverage.info
119         $(LCOV) -c -i -o - > tests/coverage.info
120         $(SHELL) '$(TESTSUITE)' -C tests CHECK_LCOV=true DISABLE_LCOV=false AUTOTEST_PATH='tests/lcov:$(AUTOTEST_PATH)' $(TESTSUITEFLAGS); \
121                 rc=$$?; \
122                 echo "Producing coverage.html..."; \
123                 cd tests && genhtml -q -o coverage.html coverage.info; \
124                 exit $$rc
125 \f
126 # valgrind support
127
128 valgrind_wrappers = \
129         tests/valgrind/ovs-appctl \
130         tests/valgrind/ovs-vsctl \
131         tests/valgrind/ovs-vswitchd \
132         tests/valgrind/ovsdb-client \
133         tests/valgrind/ovsdb-server \
134         tests/valgrind/ovsdb-tool \
135         tests/valgrind/test-aes128 \
136         tests/valgrind/test-bundle \
137         tests/valgrind/test-byte-order \
138         tests/valgrind/test-classifier \
139         tests/valgrind/test-csum \
140         tests/valgrind/test-file_name \
141         tests/valgrind/test-flows \
142         tests/valgrind/test-hash \
143         tests/valgrind/test-heap \
144         tests/valgrind/test-hmap \
145         tests/valgrind/test-json \
146         tests/valgrind/test-jsonrpc \
147         tests/valgrind/test-list \
148         tests/valgrind/test-lockfile \
149         tests/valgrind/test-multipath \
150         tests/valgrind/test-odp \
151         tests/valgrind/test-ovsdb \
152         tests/valgrind/test-packets \
153         tests/valgrind/test-random \
154         tests/valgrind/test-reconnect \
155         tests/valgrind/test-sha1 \
156         tests/valgrind/test-stp \
157         tests/valgrind/test-timeval \
158         tests/valgrind/test-type-props \
159         tests/valgrind/test-unix-socket \
160         tests/valgrind/test-uuid \
161         tests/valgrind/test-vconn
162
163 $(valgrind_wrappers): tests/valgrind-wrapper.in
164         @test -d tests/valgrind || mkdir tests/valgrind
165         sed -e 's,[@]wrap_program[@],$@,' \
166                 $(top_srcdir)/tests/valgrind-wrapper.in > $@.tmp
167         chmod +x $@.tmp
168         mv $@.tmp $@
169 CLEANFILES += $(valgrind_wrappers)
170 EXTRA_DIST += tests/valgrind-wrapper.in
171
172 VALGRIND = valgrind --log-file=valgrind.%p --leak-check=full \
173         --suppressions=$(abs_top_srcdir)/tests/openssl.supp --num-callers=20
174 EXTRA_DIST += tests/openssl.supp
175 check-valgrind: all tests/atconfig tests/atlocal $(TESTSUITE) $(valgrind_wrappers)
176         $(SHELL) '$(TESTSUITE)' -C tests CHECK_VALGRIND=true VALGRIND='$(VALGRIND)' AUTOTEST_PATH='tests/valgrind:$(AUTOTEST_PATH)' -d $(TESTSUITEFLAGS)
177         @echo
178         @echo '----------------------------------------------------------------------'
179         @echo 'Valgrind output can be found in tests/testsuite.dir/*/valgrind.*'
180         @echo '----------------------------------------------------------------------'
181 \f
182 clean-local:
183         test ! -f '$(TESTSUITE)' || $(SHELL) '$(TESTSUITE)' -C tests --clean
184
185 AUTOM4TE = autom4te
186 AUTOTEST = $(AUTOM4TE) --language=autotest
187 $(TESTSUITE): package.m4 $(TESTSUITE_AT)
188         $(AUTOTEST) -I '$(srcdir)' -o $@.tmp $@.at
189         mv $@.tmp $@
190
191 # The `:;' works around a Bash 3.2 bug when the output is not writeable.
192 $(srcdir)/package.m4: $(top_srcdir)/configure.ac
193         :;{ \
194           echo '# Signature of the current package.' && \
195           echo 'm4_define([AT_PACKAGE_NAME],      [$(PACKAGE_NAME)])' && \
196           echo 'm4_define([AT_PACKAGE_TARNAME],   [$(PACKAGE_TARNAME)])' && \
197           echo 'm4_define([AT_PACKAGE_VERSION],   [$(PACKAGE_VERSION)])' && \
198           echo 'm4_define([AT_PACKAGE_STRING],    [$(PACKAGE_STRING)])' && \
199           echo 'm4_define([AT_PACKAGE_BUGREPORT], [$(PACKAGE_BUGREPORT)])'; \
200         } >'$(srcdir)/package.m4'
201
202 noinst_PROGRAMS += tests/test-aes128
203 tests_test_aes128_SOURCES = tests/test-aes128.c
204 tests_test_aes128_LDADD = lib/libopenvswitch.a
205
206 noinst_PROGRAMS += tests/test-bundle
207 tests_test_bundle_SOURCES = tests/test-bundle.c
208 tests_test_bundle_LDADD = lib/libopenvswitch.a
209
210 noinst_PROGRAMS += tests/test-classifier
211 tests_test_classifier_SOURCES = tests/test-classifier.c
212 tests_test_classifier_LDADD = lib/libopenvswitch.a
213
214 noinst_PROGRAMS += tests/test-csum
215 tests_test_csum_SOURCES = tests/test-csum.c
216 tests_test_csum_LDADD = lib/libopenvswitch.a
217
218 noinst_PROGRAMS += tests/test-file_name
219 tests_test_file_name_SOURCES = tests/test-file_name.c
220 tests_test_file_name_LDADD = lib/libopenvswitch.a
221
222 noinst_PROGRAMS += tests/test-flows
223 tests_test_flows_SOURCES = tests/test-flows.c
224 tests_test_flows_LDADD = lib/libopenvswitch.a
225 dist_check_SCRIPTS = tests/flowgen.pl
226
227 noinst_PROGRAMS += tests/test-hash
228 tests_test_hash_SOURCES = tests/test-hash.c
229 tests_test_hash_LDADD = lib/libopenvswitch.a
230
231 noinst_PROGRAMS += tests/test-heap
232 tests_test_heap_SOURCES = tests/test-heap.c
233 tests_test_heap_LDADD = lib/libopenvswitch.a
234
235 noinst_PROGRAMS += tests/test-hmap
236 tests_test_hmap_SOURCES = tests/test-hmap.c
237 tests_test_hmap_LDADD = lib/libopenvswitch.a
238
239 noinst_PROGRAMS += tests/test-json
240 tests_test_json_SOURCES = tests/test-json.c
241 tests_test_json_LDADD = lib/libopenvswitch.a
242
243 noinst_PROGRAMS += tests/test-jsonrpc
244 tests_test_jsonrpc_SOURCES = tests/test-jsonrpc.c
245 tests_test_jsonrpc_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
246
247 noinst_PROGRAMS += tests/test-list
248 tests_test_list_SOURCES = tests/test-list.c
249 tests_test_list_LDADD = lib/libopenvswitch.a
250
251 noinst_PROGRAMS += tests/test-lockfile
252 tests_test_lockfile_SOURCES = tests/test-lockfile.c
253 tests_test_lockfile_LDADD = lib/libopenvswitch.a
254
255 noinst_PROGRAMS += tests/test-multipath
256 tests_test_multipath_SOURCES = tests/test-multipath.c
257 tests_test_multipath_LDADD = lib/libopenvswitch.a
258
259 noinst_PROGRAMS += tests/test-packets
260 tests_test_packets_SOURCES = tests/test-packets.c
261 tests_test_packets_LDADD = lib/libopenvswitch.a
262
263 noinst_PROGRAMS += tests/test-random
264 tests_test_random_SOURCES = tests/test-random.c
265 tests_test_random_LDADD = lib/libopenvswitch.a
266
267 noinst_PROGRAMS += tests/test-stp
268 tests_test_stp_SOURCES = tests/test-stp.c
269 tests_test_stp_LDADD = lib/libopenvswitch.a
270
271 noinst_PROGRAMS += tests/test-netflow
272 tests_test_netflow_SOURCES = tests/test-netflow.c
273 tests_test_netflow_LDADD = lib/libopenvswitch.a
274
275 noinst_PROGRAMS += tests/test-unix-socket
276 tests_test_unix_socket_SOURCES = tests/test-unix-socket.c
277 tests_test_unix_socket_LDADD = lib/libopenvswitch.a
278
279 noinst_PROGRAMS += tests/test-odp
280 tests_test_odp_SOURCES = tests/test-odp.c
281 tests_test_odp_LDADD = lib/libopenvswitch.a
282
283 noinst_PROGRAMS += tests/test-ovsdb
284 tests_test_ovsdb_SOURCES = \
285         tests/test-ovsdb.c \
286         tests/idltest.c \
287         tests/idltest.h
288 EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl
289 tests_test_ovsdb_LDADD = ovsdb/libovsdb.a lib/libopenvswitch.a $(SSL_LIBS)
290
291 # idltest schema and IDL
292 OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
293 IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
294 EXTRA_DIST += $(IDLTEST_IDL_FILES)
295 tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
296         $(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp
297         mv $@.tmp $@
298
299 tests/idltest.c: tests/idltest.h
300
301 noinst_PROGRAMS += tests/test-reconnect
302 tests_test_reconnect_SOURCES = tests/test-reconnect.c
303 tests_test_reconnect_LDADD = lib/libopenvswitch.a
304
305 noinst_PROGRAMS += tests/test-sha1
306 tests_test_sha1_SOURCES = tests/test-sha1.c
307 tests_test_sha1_LDADD = lib/libopenvswitch.a
308
309 noinst_PROGRAMS += tests/test-timeval
310 tests_test_timeval_SOURCES = tests/test-timeval.c
311 tests_test_timeval_LDADD = lib/libopenvswitch.a
312
313 noinst_PROGRAMS += tests/test-strtok_r
314 tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
315
316 noinst_PROGRAMS += tests/test-type-props
317 tests_test_type_props_SOURCES = tests/test-type-props.c
318
319 noinst_PROGRAMS += tests/test-util
320 tests_test_util_SOURCES = tests/test-util.c
321 tests_test_util_LDADD = lib/libopenvswitch.a
322
323 noinst_PROGRAMS += tests/test-uuid
324 tests_test_uuid_SOURCES = tests/test-uuid.c
325 tests_test_uuid_LDADD = lib/libopenvswitch.a
326
327 noinst_PROGRAMS += tests/test-vconn
328 tests_test_vconn_SOURCES = tests/test-vconn.c
329 tests_test_vconn_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
330
331 noinst_PROGRAMS += tests/test-byte-order
332 tests_test_byte_order_SOURCES = tests/test-byte-order.c
333 tests_test_byte_order_LDADD = lib/libopenvswitch.a
334
335 # Python tests.
336 EXTRA_DIST += \
337         tests/test-daemon.py \
338         tests/test-json.py \
339         tests/test-jsonrpc.py \
340         tests/test-ovsdb.py \
341         tests/test-reconnect.py \
342         tests/MockXenAPI.py \
343         tests/test-vlog.py
344
345 if HAVE_OPENSSL
346 TESTPKI_FILES = \
347         tests/testpki-cacert.pem \
348         tests/testpki-cert.pem \
349         tests/testpki-privkey.pem \
350         tests/testpki-req.pem \
351         tests/testpki-cert2.pem \
352         tests/testpki-privkey2.pem \
353         tests/testpki-req2.pem
354 check_DATA += $(TESTPKI_FILES)
355 CLEANFILES += $(TESTPKI_FILES)
356
357 tests/testpki-cacert.pem: tests/pki/stamp; cp tests/pki/switchca/cacert.pem $@
358 tests/testpki-cert.pem: tests/pki/stamp; cp tests/pki/test-cert.pem $@
359 tests/testpki-req.pem: tests/pki/stamp; cp tests/pki/test-req.pem $@
360 tests/testpki-privkey.pem: tests/pki/stamp; cp tests/pki/test-privkey.pem $@
361 tests/testpki-cert2.pem: tests/pki/stamp; cp tests/pki/test2-cert.pem $@
362 tests/testpki-req2.pem: tests/pki/stamp; cp tests/pki/test2-req.pem $@
363 tests/testpki-privkey2.pem: tests/pki/stamp; cp tests/pki/test2-privkey.pem $@
364
365 OVS_PKI = $(SHELL) $(srcdir)/utilities/ovs-pki.in --dir=tests/pki --log=tests/ovs-pki.log
366 tests/pki/stamp:
367         rm -f tests/pki/stamp
368         rm -rf tests/pki
369         $(OVS_PKI) init
370         $(OVS_PKI) req+sign tests/pki/test
371         $(OVS_PKI) req+sign tests/pki/test2
372         : > tests/pki/stamp
373 CLEANFILES += tests/ovs-pki.log
374
375 CLEAN_LOCAL += clean-pki
376 clean-pki:
377         rm -f tests/pki/stamp
378         rm -rf tests/pki
379 endif