datapath: Avoid pskb_may_pull() checks where not needed.
[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/vconn.at \
16         tests/dir_name.at \
17         tests/aes128.at \
18         tests/uuid.at \
19         tests/json.at \
20         tests/jsonrpc.at \
21         tests/jsonrpc-py.at \
22         tests/timeval.at \
23         tests/lockfile.at \
24         tests/reconnect.at \
25         tests/ovsdb.at \
26         tests/ovsdb-log.at \
27         tests/ovsdb-types.at \
28         tests/ovsdb-data.at \
29         tests/ovsdb-column.at \
30         tests/ovsdb-table.at \
31         tests/ovsdb-row.at \
32         tests/ovsdb-schema.at \
33         tests/ovsdb-condition.at \
34         tests/ovsdb-mutation.at \
35         tests/ovsdb-query.at \
36         tests/ovsdb-transaction.at \
37         tests/ovsdb-execution.at \
38         tests/ovsdb-trigger.at \
39         tests/ovsdb-tool.at \
40         tests/ovsdb-server.at \
41         tests/ovsdb-monitor.at \
42         tests/ovsdb-idl.at \
43         tests/ovsdb-idl-py.at \
44         tests/ovs-vsctl.at \
45         tests/interface-reconfigure.at
46 TESTSUITE = $(srcdir)/tests/testsuite
47 DISTCLEANFILES += tests/atconfig tests/atlocal $(TESTSUITE)
48
49 AUTOTEST_PATH = utilities:vswitchd:ovsdb:tests
50
51 check-local: tests/atconfig tests/atlocal $(TESTSUITE)
52         $(SHELL) '$(TESTSUITE)' -C tests AUTOTEST_PATH=$(AUTOTEST_PATH) $(TESTSUITEFLAGS)
53 \f
54 # lcov support
55
56 lcov_wrappers = \
57         tests/lcov/ovs-appctl \
58         tests/lcov/ovs-vsctl \
59         tests/lcov/ovsdb-client \
60         tests/lcov/ovsdb-server \
61         tests/lcov/ovsdb-tool \
62         tests/lcov/test-aes128 \
63         tests/lcov/test-classifier \
64         tests/lcov/test-csum \
65         tests/lcov/test-dhcp-client \
66         tests/lcov/test-dir_name \
67         tests/lcov/test-flows \
68         tests/lcov/test-hash \
69         tests/lcov/test-hmap \
70         tests/lcov/test-json \
71         tests/lcov/test-jsonrpc \
72         tests/lcov/test-list \
73         tests/lcov/test-lockfile \
74         tests/lcov/test-ovsdb \
75         tests/lcov/test-reconnect \
76         tests/lcov/test-sha1 \
77         tests/lcov/test-timeval \
78         tests/lcov/test-type-props \
79         tests/lcov/test-uuid \
80         tests/lcov/test-vconn
81
82 $(lcov_wrappers): tests/lcov-wrapper.in
83         @test -d tests/lcov || mkdir tests/lcov
84         sed -e 's,[@]abs_top_builddir[@],$(abs_top_builddir),' \
85             -e 's,[@]wrap_program[@],$@,' \
86                 $(top_srcdir)/tests/lcov-wrapper.in > $@.tmp
87         chmod +x $@.tmp
88         mv $@.tmp $@
89 CLEANFILES += $(lcov_wrappers)
90 EXTRA_DIST += tests/lcov-wrapper.in
91
92 LCOV = lcov -b $(abs_top_builddir) -d $(abs_top_builddir) -q
93 check-lcov: all tests/atconfig tests/atlocal $(TESTSUITE) $(lcov_wrappers)
94         rm -fr tests/coverage.html tests/coverage.info
95         $(LCOV) -c -i -o - > tests/coverage.info
96         $(SHELL) '$(TESTSUITE)' -C tests CHECK_LCOV=true DISABLE_LCOV=false AUTOTEST_PATH='tests/lcov:$(AUTOTEST_PATH)' $(TESTSUITEFLAGS); \
97                 rc=$$?; \
98                 echo "Producing coverage.html..."; \
99                 cd tests && genhtml -q -o coverage.html coverage.info; \
100                 exit $$rc
101 \f
102 # valgrind support
103
104 valgrind_wrappers = \
105         tests/valgrind/ovs-appctl \
106         tests/valgrind/ovs-vsctl \
107         tests/valgrind/ovsdb-client \
108         tests/valgrind/ovsdb-server \
109         tests/valgrind/ovsdb-tool \
110         tests/valgrind/test-aes128 \
111         tests/valgrind/test-classifier \
112         tests/valgrind/test-csum \
113         tests/valgrind/test-dhcp-client \
114         tests/valgrind/test-dir_name \
115         tests/valgrind/test-flows \
116         tests/valgrind/test-hash \
117         tests/valgrind/test-hmap \
118         tests/valgrind/test-json \
119         tests/valgrind/test-jsonrpc \
120         tests/valgrind/test-list \
121         tests/valgrind/test-lockfile \
122         tests/valgrind/test-ovsdb \
123         tests/valgrind/test-reconnect \
124         tests/valgrind/test-sha1 \
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 = tests/test-classifier.c
175 tests_test_classifier_LDADD = lib/libopenvswitch.a
176
177 noinst_PROGRAMS += tests/test-csum
178 tests_test_csum_SOURCES = tests/test-csum.c
179 tests_test_csum_LDADD = lib/libopenvswitch.a
180
181 noinst_PROGRAMS += tests/test-dir_name
182 tests_test_dir_name_SOURCES = tests/test-dir_name.c
183 tests_test_dir_name_LDADD = lib/libopenvswitch.a
184
185 noinst_PROGRAMS += tests/test-flows
186 tests_test_flows_SOURCES = tests/test-flows.c
187 tests_test_flows_LDADD = lib/libopenvswitch.a
188 dist_check_SCRIPTS = tests/flowgen.pl
189
190 noinst_PROGRAMS += tests/test-hash
191 tests_test_hash_SOURCES = tests/test-hash.c
192 tests_test_hash_LDADD = lib/libopenvswitch.a
193
194 noinst_PROGRAMS += tests/test-hmap
195 tests_test_hmap_SOURCES = tests/test-hmap.c
196 tests_test_hmap_LDADD = lib/libopenvswitch.a
197
198 noinst_PROGRAMS += tests/test-json
199 tests_test_json_SOURCES = tests/test-json.c
200 tests_test_json_LDADD = lib/libopenvswitch.a
201
202 noinst_PROGRAMS += tests/test-jsonrpc
203 tests_test_jsonrpc_SOURCES = tests/test-jsonrpc.c
204 tests_test_jsonrpc_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
205
206 noinst_PROGRAMS += tests/test-list
207 tests_test_list_SOURCES = tests/test-list.c
208 tests_test_list_LDADD = lib/libopenvswitch.a
209
210 noinst_PROGRAMS += tests/test-lockfile
211 tests_test_lockfile_SOURCES = tests/test-lockfile.c
212 tests_test_lockfile_LDADD = lib/libopenvswitch.a
213
214 noinst_PROGRAMS += tests/test-ovsdb
215 tests_test_ovsdb_SOURCES = \
216         tests/test-ovsdb.c \
217         tests/idltest.c \
218         tests/idltest.h
219 EXTRA_DIST += tests/uuidfilt.pl tests/ovsdb-monitor-sort.pl
220 tests_test_ovsdb_LDADD = ovsdb/libovsdb.a lib/libopenvswitch.a $(SSL_LIBS)
221
222 # idltest schema and IDL
223 OVSIDL_BUILT += tests/idltest.c tests/idltest.h tests/idltest.ovsidl
224 IDLTEST_IDL_FILES = tests/idltest.ovsschema tests/idltest.ann
225 EXTRA_DIST += $(IDLTEST_IDL_FILES)
226 tests/idltest.ovsidl: $(IDLTEST_IDL_FILES)
227         $(OVSDB_IDLC) -C $(srcdir) annotate $(IDLTEST_IDL_FILES) > $@.tmp
228         mv $@.tmp $@
229
230 tests/idltest.c: tests/idltest.h
231
232 noinst_PROGRAMS += tests/test-reconnect
233 tests_test_reconnect_SOURCES = tests/test-reconnect.c
234 tests_test_reconnect_LDADD = lib/libopenvswitch.a
235
236 noinst_PROGRAMS += tests/test-sha1
237 tests_test_sha1_SOURCES = tests/test-sha1.c
238 tests_test_sha1_LDADD = lib/libopenvswitch.a
239
240 noinst_PROGRAMS += tests/test-timeval
241 tests_test_timeval_SOURCES = tests/test-timeval.c
242 tests_test_timeval_LDADD = lib/libopenvswitch.a
243
244 noinst_PROGRAMS += tests/test-strtok_r
245 tests_test_strtok_r_SOURCES = tests/test-strtok_r.c
246
247 noinst_PROGRAMS += tests/test-type-props
248 tests_test_type_props_SOURCES = tests/test-type-props.c
249
250 noinst_PROGRAMS += tests/test-dhcp-client
251 tests_test_dhcp_client_SOURCES = tests/test-dhcp-client.c
252 tests_test_dhcp_client_LDADD = lib/libopenvswitch.a
253
254 noinst_PROGRAMS += tests/test-uuid
255 tests_test_uuid_SOURCES = tests/test-uuid.c
256 tests_test_uuid_LDADD = lib/libopenvswitch.a
257
258 noinst_PROGRAMS += tests/test-vconn
259 tests_test_vconn_SOURCES = tests/test-vconn.c
260 tests_test_vconn_LDADD = lib/libopenvswitch.a $(SSL_LIBS)
261 EXTRA_DIST += \
262         tests/testpki-cacert.pem \
263         tests/testpki-cert.pem \
264         tests/testpki-cert2.pem \
265         tests/testpki-privkey.pem \
266         tests/testpki-privkey2.pem \
267         tests/testpki-req.pem \
268         tests/testpki-req2.pem
269
270 # Python tests.
271 EXTRA_DIST += \
272         tests/test-daemon.py \
273         tests/test-json.py \
274         tests/test-jsonrpc.py \
275         tests/test-ovsdb.py \
276         tests/test-reconnect.py