Disable a debug option
[platform/upstream/curl.git] / tests / Makefile.am
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
25 HTMLPAGES = testcurl.html runtests.html
26 PDFPAGES = testcurl.pdf runtests.pdf
27 MANDISTPAGES = runtests.1.dist testcurl.1.dist
28
29 EXTRA_DIST = appveyor.pm azure.pm badsymbols.pl check-deprecated.pl CMakeLists.txt \
30  devtest.pl dictserver.py directories.pm disable-scan.pl error-codes.pl extern-scan.pl FILEFORMAT.md \
31  processhelp.pm ftpserver.pl getpart.pm globalconfig.pm http-server.pl http2-server.pl \
32  http3-server.pl manpage-scan.pl manpage-syntax.pl markdown-uppercase.pl mem-include-scan.pl \
33  memanalyze.pl negtelnetserver.py nroff-scan.pl option-check.pl options-scan.pl \
34  pathhelp.pm README.md rtspserver.pl runner.pm runtests.1 runtests.pl secureserver.pl \
35  serverhelp.pm servers.pm smbserver.py sshhelp.pm sshserver.pl stunnel.pem symbol-scan.pl \
36  testcurl.1 testcurl.pl testutil.pm tftpserver.pl util.py valgrind.pm \
37  valgrind.supp version-scan.pl check-translatable-options.pl
38
39 DISTCLEANFILES = configurehelp.pm
40
41 # we have two variables here to make sure DIST_SUBDIRS won't get 'unit'
42 # added twice as then targets such as 'distclean' misbehave and try to
43 # do things twice in that subdir at times (and thus fails).
44 if BUILD_UNITTESTS
45 BUILD_UNIT = unit
46 DIST_UNIT =
47 else
48 BUILD_UNIT =
49 DIST_UNIT = unit
50 endif
51
52 SUBDIRS = certs data server libtest http $(BUILD_UNIT)
53 DIST_SUBDIRS = $(SUBDIRS) $(DIST_UNIT)
54
55 PERLFLAGS = -I$(srcdir)
56
57 CLEANFILES = .http.pid .https.pid .ftp.pid .ftps.pid $(MANDISTPAGES)
58
59 MAN2HTML= roffit $< >$@
60
61 curl:
62         @cd $(top_builddir) && $(MAKE)
63
64 if CROSSCOMPILING
65 TEST = @echo "NOTICE: we can't run the tests when cross-compiling!"
66 else # if not cross-compiling:
67 TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl
68 TEST_Q = -a -s
69 TEST_AM = -a -am
70 TEST_F = -a -p -r
71 TEST_T = -a -t
72 TEST_E = -a -e
73
74 # ~<keyword> means that it will run all tests matching the keyword, but will
75 # ignore their results (since these ones are likely to fail for no good reason)
76 TEST_NF = -a -p ~flaky ~timing-dependent
77
78 # special CI target derived from nonflaky with CI-specific flags
79 TEST_CI = $(TEST_NF) -rm
80 endif
81
82 # make sure that PERL is pointing to an executable
83 perlcheck:
84         @if ! test -x "$(PERL)"; then echo "No perl!"; exit 2; fi
85
86 test: perlcheck all
87         $(TEST) $(TFLAGS)
88
89 quiet-test: perlcheck all
90         $(TEST) $(TEST_Q) $(TFLAGS)
91
92 am-test: perlcheck all
93         $(TEST) $(TEST_AM) $(TFLAGS)
94
95 ci-test: perlcheck all
96         $(TEST) $(TEST_CI) $(TFLAGS)
97
98 full-test: perlcheck all
99         $(TEST) $(TEST_F) $(TFLAGS)
100
101 nonflaky-test: perlcheck all
102         $(TEST) $(TEST_NF) $(TFLAGS)
103
104 torture-test: perlcheck all
105         $(TEST) $(TEST_T) $(TFLAGS)
106
107 event-test: perlcheck all
108         $(TEST) $(TEST_E) $(TFLAGS)
109
110 .1.html:
111         $(MAN2HTML)
112
113 .1.pdf:
114         @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \
115         groff -Tps -man $< >$$foo.ps; \
116         ps2pdf $$foo.ps $@; \
117         rm $$foo.ps; \
118         echo "converted $< to $@")
119
120 checksrc:
121         (cd libtest && $(MAKE) checksrc)
122         (cd unit && $(MAKE) checksrc)
123         (cd server && $(MAKE) checksrc)
124         (cd http && $(MAKE) checksrc)
125
126 if CURLDEBUG
127 # for debug builds, we scan the sources on all regular make invokes
128 all-local: checksrc
129 endif