Imported Upstream version 7.59.0
[platform/upstream/curl.git] / tests / Makefile.am
1 #***************************************************************************
2 #                                  _   _ ____  _
3 #  Project                     ___| | | |  _ \| |
4 #                             / __| | | | |_) | |
5 #                            | (__| |_| |  _ <| |___
6 #                             \___|\___/|_| \_\_____|
7 #
8 # Copyright (C) 1998 - 2017, 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.haxx.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 ###########################################################################
22
23 HTMLPAGES = testcurl.html runtests.html
24 PDFPAGES = testcurl.pdf runtests.pdf
25 MANDISTPAGES = runtests.1.dist testcurl.1.dist
26
27 # the path to the impacket python lib used for SMB tests
28 IMP = python_dependencies/impacket
29 SMBDEPS = $(IMP)/__init__.py $(IMP)/nmb.py $(IMP)/nt_errors.py          \
30  $(IMP)/ntlm.py $(IMP)/smb.py $(IMP)/smb3.py $(IMP)/smb3structs.py      \
31  $(IMP)/smbserver.py $(IMP)/spnego.py $(IMP)/structure.py               \
32  $(IMP)/uuid.py $(IMP)/version.py smbserver.py curl_test_data.py
33
34 EXTRA_DIST = ftpserver.pl httpserver.pl secureserver.pl runtests.pl getpart.pm \
35  FILEFORMAT README stunnel.pem memanalyze.pl testcurl.pl valgrind.pm ftp.pm   \
36  sshserver.pl sshhelp.pm pathhelp.pm testcurl.1 runtests.1 \
37  serverhelp.pm tftpserver.pl rtspserver.pl directories.pm symbol-scan.pl \
38  CMakeLists.txt mem-include-scan.pl valgrind.supp http_pipe.py extern-scan.pl \
39  manpage-scan.pl nroff-scan.pl http2-server.pl dictserver.py \
40  negtelnetserver.py $(SMBDEPS)
41
42 DISTCLEANFILES = configurehelp.pm
43
44 # we have two variables here to make sure DIST_SUBDIRS won't get 'unit'
45 # added twice as then targets such as 'distclean' misbehave and try to
46 # do things twice in that subdir at times (and thus fails).
47 if BUILD_UNITTESTS
48 BUILD_UNIT = unit
49 DIST_UNIT =
50 else
51 BUILD_UNIT =
52 DIST_UNIT = unit
53 endif
54
55 SUBDIRS = certs data server libtest $(BUILD_UNIT)
56 DIST_SUBDIRS = $(SUBDIRS) $(DIST_UNIT)
57
58 PERLFLAGS = -I$(srcdir)
59
60 CLEANFILES = .http.pid .https.pid .ftp.pid .ftps.pid $(MANDISTPAGES)
61
62 MAN2HTML= roffit $< >$@
63
64 curl:
65         @cd $(top_builddir) && $(MAKE)
66
67 if CROSSCOMPILING
68 TEST = @echo "NOTICE: we can't run the tests when cross-compiling!"
69 else # if not cross-compiling:
70 TEST = srcdir=$(srcdir) $(PERL) $(PERLFLAGS) $(srcdir)/runtests.pl
71 TEST_Q = -a -s
72 TEST_AM = -a -am
73 TEST_F = -a -p -r
74 TEST_T = -a -t
75 TEST_E = -a -e
76
77 # !flaky means that it'll skip all tests using the flaky keyword
78 TEST_NF = -a -p -r !flaky
79 endif
80
81 # make sure that PERL is pointing to an executable
82 perlcheck:
83         @if ! test -x "$(PERL)"; then echo "No perl!"; exit 2; fi
84
85 test: perlcheck all
86         $(TEST) $(TFLAGS)
87
88 quiet-test: perlcheck all
89         $(TEST) $(TEST_Q) $(TFLAGS)
90
91 am-test: perlcheck all
92         $(TEST) $(TEST_AM) $(TFLAGS)
93
94 full-test: perlcheck all
95         $(TEST) $(TEST_F) $(TFLAGS)
96
97 nonflaky-test: perlcheck all
98         $(TEST) $(TEST_NF) $(TFLAGS)
99
100 torture-test: perlcheck all
101         $(TEST) $(TEST_T) $(TFLAGS)
102
103 event-test: perlcheck all
104         $(TEST) $(TEST_E) $(TFLAGS)
105
106 .1.html:
107         $(MAN2HTML)
108
109 .1.pdf:
110         @(foo=`echo $@ | sed -e 's/\.[0-9]$$//g'`; \
111         groff -Tps -man $< >$$foo.ps; \
112         ps2pdf $$foo.ps $@; \
113         rm $$foo.ps; \
114         echo "converted $< to $@")
115
116 checksrc:
117         cd libtest && $(MAKE) checksrc
118         cd unit && $(MAKE) checksrc
119         cd server && $(MAKE) checksrc
120
121 if CURLDEBUG
122 # for debug builds, we scan the sources on all regular make invokes
123 all-local: checksrc
124 endif