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