xref: /curl/tests/Makefile.am (revision b6219cd9)
1#***************************************************************************
2#                                  _   _ ____  _
3#  Project                     ___| | | |  _ \| |
4#                             / __| | | | |_) | |
5#                            | (__| |_| |  _ <| |___
6#                             \___|\___/|_| \_\_____|
7#
8# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
9#
10# This software is licensed as described in the file COPYING, which
11# you should have received as part of this distribution. The terms
12# are also available at https://curl.se/docs/copyright.html.
13#
14# You may opt to use, copy, modify, merge, publish, distribute and/or sell
15# copies of the Software, and permit persons to whom the Software is
16# furnished to do so, under the terms of the COPYING file.
17#
18# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19# KIND, either express or implied.
20#
21# SPDX-License-Identifier: curl
22#
23###########################################################################
24
25if BUILD_DOCS
26# if we disable man page building, ignore these
27RUNTESTS_DOCS = runtests.1
28TESTCURL_DOCS = testcurl.1
29MANFILES = $(RUNTESTS_DOCS) $(TESTCURL_DOCS)
30endif
31
32CURLPAGES = runtests.md testcurl.md
33
34# scripts used in test cases
35TESTSCRIPTS = \
36 test1119.pl  \
37 test1132.pl  \
38 test1135.pl  \
39 test1139.pl  \
40 test1140.pl  \
41 test1165.pl  \
42 test1167.pl  \
43 test1173.pl  \
44 test1175.pl  \
45 test1177.pl  \
46 test1222.pl  \
47 test1275.pl  \
48 test1276.pl  \
49 test1477.pl  \
50 test1486.pl  \
51 test1488.pl  \
52 test1544.pl  \
53 test1707.pl  \
54 test971.pl
55
56EXTRA_DIST =        \
57 CMakeLists.txt     \
58 FILEFORMAT.md      \
59 README.md          \
60 appveyor.pm        \
61 azure.pm           \
62 devtest.pl         \
63 dictserver.py      \
64 directories.pm     \
65 ech_combos.py      \
66 ech_tests.sh       \
67 ftpserver.pl       \
68 getpart.pm         \
69 globalconfig.pm    \
70 http-server.pl     \
71 http2-server.pl    \
72 http3-server.pl    \
73 memanalyze.pl      \
74 mk-bundle-hints.sh \
75 mk-bundle.pl       \
76 negtelnetserver.py \
77 nghttpx.conf       \
78 pathhelp.pm        \
79 processhelp.pm     \
80 requirements.txt   \
81 rtspserver.pl      \
82 runner.pm          \
83 runtests.pl        \
84 secureserver.pl    \
85 serverhelp.pm      \
86 servers.pm         \
87 smbserver.py       \
88 sshhelp.pm         \
89 sshserver.pl       \
90 stunnel.pem        \
91 testcurl.pl        \
92 testutil.pm        \
93 tftpserver.pl      \
94 util.py            \
95 valgrind.pm        \
96 valgrind.supp      \
97 $(TESTSCRIPTS)     \
98 $(CURLPAGES)
99
100# we have two variables here to make sure DIST_SUBDIRS won't get 'unit'
101# added twice as then targets such as 'distclean' misbehave and try to
102# do things twice in that subdir at times (and thus fails).
103if BUILD_UNITTESTS
104BUILD_UNIT = unit
105DIST_UNIT =
106else
107BUILD_UNIT =
108DIST_UNIT = unit
109endif
110
111SUBDIRS = certs data server libtest http $(BUILD_UNIT)
112DIST_SUBDIRS = $(SUBDIRS) $(DIST_UNIT)
113
114PERLFLAGS = -I$(srcdir)
115
116CLEANFILES = .http.pid .https.pid .ftp.pid .ftps.pid $(MANDISTPAGES)
117
118curl:
119	@cd $(top_builddir) && $(MAKE)
120
121TEST_COMMON =
122
123if CROSSCOMPILING
124TEST = @echo "NOTICE: we can't run the tests when cross-compiling!"
125PYTEST = $(TEST)
126else # if not cross-compiling:
127if USE_TEST_BUNDLES
128TEST_COMMON += -bundle
129endif
130
131TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl $(TEST_COMMON)
132TEST_Q = -a -s
133TEST_AM = -a -am
134TEST_F = -a -p -r
135TEST_T = -a -t -j20
136TEST_E = -a -e
137
138# ~<keyword> means that it will run all tests matching the keyword, but will
139# ignore their results (since these ones are likely to fail for no good reason)
140TEST_NF = -a -p ~flaky ~timing-dependent
141
142# special CI target derived from nonflaky with CI-specific flags
143TEST_CI = $(TEST_NF) -r -rm -j20
144
145PYTEST = pytest
146endif
147
148CD2NROFF = $(top_srcdir)/scripts/cd2nroff $< >$@
149
150SUFFIXES = .1 .md
151
152.md.1:
153	$(CD2)$(CD2NROFF)
154
155# make sure that PERL is pointing to an executable
156perlcheck:
157	@if ! test -x "$(PERL)"; then echo "No perl!"; exit 2; fi
158
159test: perlcheck all
160	$(TEST) $(TFLAGS)
161
162quiet-test: perlcheck all
163	$(TEST) $(TEST_Q) $(TFLAGS)
164
165am-test: perlcheck all
166	$(TEST) $(TEST_AM) $(TFLAGS)
167
168ci-test: perlcheck all
169	$(TEST) $(TEST_CI) $(TFLAGS)
170
171full-test: perlcheck all
172	$(TEST) $(TEST_F) $(TFLAGS)
173
174nonflaky-test: perlcheck all
175	$(TEST) $(TEST_NF) $(TFLAGS)
176
177torture-test: perlcheck all
178	$(TEST) $(TEST_T) $(TFLAGS)
179
180event-test: perlcheck all
181	$(TEST) $(TEST_E) $(TFLAGS)
182
183default-pytest: ci-pytest
184
185ci-pytest: all
186	srcdir=$(srcdir) $(PYTEST) -v $(srcdir)/http
187
188checksrc:
189	(cd libtest && $(MAKE) checksrc)
190	(cd unit && $(MAKE) checksrc)
191	(cd server && $(MAKE) checksrc)
192	(cd http && $(MAKE) checksrc)
193
194all-local: $(MANFILES)
195
196distclean:
197	rm -f $(MANFILES)
198