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