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