113498266Sopenharmony_ci#***************************************************************************
213498266Sopenharmony_ci#                                  _   _ ____  _
313498266Sopenharmony_ci#  Project                     ___| | | |  _ \| |
413498266Sopenharmony_ci#                             / __| | | | |_) | |
513498266Sopenharmony_ci#                            | (__| |_| |  _ <| |___
613498266Sopenharmony_ci#                             \___|\___/|_| \_\_____|
713498266Sopenharmony_ci#
813498266Sopenharmony_ci# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
913498266Sopenharmony_ci#
1013498266Sopenharmony_ci# This software is licensed as described in the file COPYING, which
1113498266Sopenharmony_ci# you should have received as part of this distribution. The terms
1213498266Sopenharmony_ci# are also available at https://curl.se/docs/copyright.html.
1313498266Sopenharmony_ci#
1413498266Sopenharmony_ci# You may opt to use, copy, modify, merge, publish, distribute and/or sell
1513498266Sopenharmony_ci# copies of the Software, and permit persons to whom the Software is
1613498266Sopenharmony_ci# furnished to do so, under the terms of the COPYING file.
1713498266Sopenharmony_ci#
1813498266Sopenharmony_ci# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
1913498266Sopenharmony_ci# KIND, either express or implied.
2013498266Sopenharmony_ci#
2113498266Sopenharmony_ci# SPDX-License-Identifier: curl
2213498266Sopenharmony_ci#
2313498266Sopenharmony_ci###########################################################################
2413498266Sopenharmony_ci
2513498266Sopenharmony_ciMANDISTPAGES = runtests.1.dist testcurl.1.dist
2613498266Sopenharmony_ci
2713498266Sopenharmony_ci# scripts used in test cases
2813498266Sopenharmony_ciTESTSCRIPTS = \
2913498266Sopenharmony_ci test1119.pl  \
3013498266Sopenharmony_ci test1132.pl  \
3113498266Sopenharmony_ci test1135.pl  \
3213498266Sopenharmony_ci test1139.pl  \
3313498266Sopenharmony_ci test1140.pl  \
3413498266Sopenharmony_ci test1165.pl  \
3513498266Sopenharmony_ci test1167.pl  \
3613498266Sopenharmony_ci test1173.pl  \
3713498266Sopenharmony_ci test1175.pl  \
3813498266Sopenharmony_ci test1177.pl  \
3913498266Sopenharmony_ci test1222.pl  \
4013498266Sopenharmony_ci test1275.pl  \
4113498266Sopenharmony_ci test1276.pl  \
4213498266Sopenharmony_ci test1477.pl  \
4313498266Sopenharmony_ci test1544.pl  \
4413498266Sopenharmony_ci test971.pl
4513498266Sopenharmony_ci
4613498266Sopenharmony_ciEXTRA_DIST = appveyor.pm azure.pm CMakeLists.txt devtest.pl             \
4713498266Sopenharmony_ci dictserver.py directories.pm FILEFORMAT.md processhelp.pm ftpserver.pl \
4813498266Sopenharmony_ci getpart.pm globalconfig.pm http-server.pl http2-server.pl              \
4913498266Sopenharmony_ci http3-server.pl memanalyze.pl negtelnetserver.py pathhelp.pm README.md \
5013498266Sopenharmony_ci rtspserver.pl runner.pm runtests.1 runtests.pl secureserver.pl         \
5113498266Sopenharmony_ci serverhelp.pm servers.pm smbserver.py sshhelp.pm sshserver.pl          \
5213498266Sopenharmony_ci stunnel.pem testcurl.1 testcurl.pl testutil.pm tftpserver.pl util.py   \
5313498266Sopenharmony_ci valgrind.pm valgrind.supp $(TESTSCRIPTS)
5413498266Sopenharmony_ci
5513498266Sopenharmony_ciDISTCLEANFILES = configurehelp.pm
5613498266Sopenharmony_ci
5713498266Sopenharmony_ci# we have two variables here to make sure DIST_SUBDIRS won't get 'unit'
5813498266Sopenharmony_ci# added twice as then targets such as 'distclean' misbehave and try to
5913498266Sopenharmony_ci# do things twice in that subdir at times (and thus fails).
6013498266Sopenharmony_ciif BUILD_UNITTESTS
6113498266Sopenharmony_ciBUILD_UNIT = unit
6213498266Sopenharmony_ciDIST_UNIT =
6313498266Sopenharmony_cielse
6413498266Sopenharmony_ciBUILD_UNIT =
6513498266Sopenharmony_ciDIST_UNIT = unit
6613498266Sopenharmony_ciendif
6713498266Sopenharmony_ci
6813498266Sopenharmony_ciSUBDIRS = certs data server libtest http $(BUILD_UNIT)
6913498266Sopenharmony_ciDIST_SUBDIRS = $(SUBDIRS) $(DIST_UNIT)
7013498266Sopenharmony_ci
7113498266Sopenharmony_ciPERLFLAGS = -I$(srcdir)
7213498266Sopenharmony_ci
7313498266Sopenharmony_ciCLEANFILES = .http.pid .https.pid .ftp.pid .ftps.pid $(MANDISTPAGES)
7413498266Sopenharmony_ci
7513498266Sopenharmony_cicurl:
7613498266Sopenharmony_ci	@cd $(top_builddir) && $(MAKE)
7713498266Sopenharmony_ci
7813498266Sopenharmony_ciif CROSSCOMPILING
7913498266Sopenharmony_ciTEST = @echo "NOTICE: we can't run the tests when cross-compiling!"
8013498266Sopenharmony_cielse # if not cross-compiling:
8113498266Sopenharmony_ciTEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl
8213498266Sopenharmony_ciTEST_Q = -a -s
8313498266Sopenharmony_ciTEST_AM = -a -am
8413498266Sopenharmony_ciTEST_F = -a -p -r
8513498266Sopenharmony_ciTEST_T = -a -t
8613498266Sopenharmony_ciTEST_E = -a -e
8713498266Sopenharmony_ci
8813498266Sopenharmony_ci# ~<keyword> means that it will run all tests matching the keyword, but will
8913498266Sopenharmony_ci# ignore their results (since these ones are likely to fail for no good reason)
9013498266Sopenharmony_ciTEST_NF = -a -p ~flaky ~timing-dependent
9113498266Sopenharmony_ci
9213498266Sopenharmony_ci# special CI target derived from nonflaky with CI-specific flags
9313498266Sopenharmony_ciTEST_CI = $(TEST_NF) -rm
9413498266Sopenharmony_ciendif
9513498266Sopenharmony_ci
9613498266Sopenharmony_ci# make sure that PERL is pointing to an executable
9713498266Sopenharmony_ciperlcheck:
9813498266Sopenharmony_ci	@if ! test -x "$(PERL)"; then echo "No perl!"; exit 2; fi
9913498266Sopenharmony_ci
10013498266Sopenharmony_citest: perlcheck all
10113498266Sopenharmony_ci	$(TEST) $(TFLAGS)
10213498266Sopenharmony_ci
10313498266Sopenharmony_ciquiet-test: perlcheck all
10413498266Sopenharmony_ci	$(TEST) $(TEST_Q) $(TFLAGS)
10513498266Sopenharmony_ci
10613498266Sopenharmony_ciam-test: perlcheck all
10713498266Sopenharmony_ci	$(TEST) $(TEST_AM) $(TFLAGS)
10813498266Sopenharmony_ci
10913498266Sopenharmony_cici-test: perlcheck all
11013498266Sopenharmony_ci	$(TEST) $(TEST_CI) $(TFLAGS)
11113498266Sopenharmony_ci
11213498266Sopenharmony_cifull-test: perlcheck all
11313498266Sopenharmony_ci	$(TEST) $(TEST_F) $(TFLAGS)
11413498266Sopenharmony_ci
11513498266Sopenharmony_cinonflaky-test: perlcheck all
11613498266Sopenharmony_ci	$(TEST) $(TEST_NF) $(TFLAGS)
11713498266Sopenharmony_ci
11813498266Sopenharmony_citorture-test: perlcheck all
11913498266Sopenharmony_ci	$(TEST) $(TEST_T) $(TFLAGS)
12013498266Sopenharmony_ci
12113498266Sopenharmony_cievent-test: perlcheck all
12213498266Sopenharmony_ci	$(TEST) $(TEST_E) $(TFLAGS)
12313498266Sopenharmony_ci
12413498266Sopenharmony_cichecksrc:
12513498266Sopenharmony_ci	(cd libtest && $(MAKE) checksrc)
12613498266Sopenharmony_ci	(cd unit && $(MAKE) checksrc)
12713498266Sopenharmony_ci	(cd server && $(MAKE) checksrc)
12813498266Sopenharmony_ci	(cd http && $(MAKE) checksrc)
12913498266Sopenharmony_ci
13013498266Sopenharmony_ciif CURLDEBUG
13113498266Sopenharmony_ci# for debug builds, we scan the sources on all regular make invokes
13213498266Sopenharmony_ciall-local: checksrc
13313498266Sopenharmony_ciendif
134