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