Lines Matching +full:python +full:- +full:test
1 <!--
4 SPDX-License-Identifier: curl
5 -->
7 # The curl Test Suite
15 ./configure && make && make test
19 make test TFLAGS="303 410"
21 To run the tests faster, pass the -j (parallelism) flag:
23 make test TFLAGS="-j10"
25 "make test" builds the test suite support code and invokes the 'runtests.pl'
29 When you run tests via make, the flags `-a` and `-s` are passed, meaning
37 You must have run `make test` at least once first to build the support code.
43 After a test fails, examine the tests/log directory for stdout, stderr, and
44 output from the servers used in the test.
48 - perl (and a unix-style shell)
49 - python (and a unix-style shell, for SMB and TELNET tests)
50 - python-impacket (for SMB tests)
51 - diff (when a test fails, a diff is shown)
52 - stunnel (for HTTPS and FTPS tests)
53 - OpenSSH or SunSSH (for SCP and SFTP tests)
54 - nghttpx (for HTTP/2 and HTTP/3 tests)
55 - An available `en_US.UTF-8` locale
57 ### Installation of python-impacket
59 The Python-based test servers support both recent Python 2 and 3.
60 You can figure out your default Python interpreter with python -V
62 Please install python-impacket in the correct Python environment.
67 - Python 2: 'python-impacket'
68 - Python 3: 'python3-impacket'
72 - Python 2: 'py27-impacket'
73 - Python 3: 'py37-impacket'
77 - Python 2: 'pip2 install impacket'
78 - Python 3: 'pip3 install impacket'
80 You may also need to manually install the Python package 'six'
81 as that may be a missing requirement for impacket on Python 3.
83 ### Port numbers used by test servers
85 All test servers run on "random" port numbers. All tests should be written
86 to use suitable variables instead of fixed port numbers so that test cases
87 continue to work independent on what port numbers the test servers actually
92 ### Test servers
94 The test suite runs stand-alone servers on random ports to which it makes
98 The listen port numbers for the test servers are picked randomly to allow
99 users to run multiple test cases concurrently and to not collide with other
108 changed by specifying `--with-test-nghttpx=<path>` as argument to `configure`.
112 Tests which use the ssh test server, SCP/SFTP tests, might be badly
117 expected stream of data which flows to the sftp-server or from the ssh
118 client which can result in bad test behavior or even prevent the test server
121 If the test suite ssh or sftp server fails to start up and logs the message
126 ### Memory test
128 The test script will check that all allocated memory is freed properly IF
134 use valgrind to run the test with (unless you use `-n`) to further verify
137 The `runtests.pl` `-t` option enables torture testing mode. It runs each
138 test many times and makes each different memory allocation fail on each
141 compile curl with `CPPFLAGS=-DMEMDEBUG_LOG_SYNC` when using this option, to
146 If a test case fails, you can conveniently get the script to invoke the
148 parameters that failed. Just invoke `runtests.pl <test number> -g` and then
154 runtests.pl script). They remain in there after a test run.
158 A curl build with `--enable-debug` offers more verbose output in the logs.
159 This applies not only for test cases, but also when running it standalone
160 with `curl -v`. While a curl debug built is
168 CURL_DEBUG=ssl curl -v https://curl.se
174 CURL_DEBUG=ssl,http/2 curl -v https://curl.se
185 ### Test input files
187 All test cases are put in the `data/` subdirectory. Each test is stored in
188 the file named according to the test number.
190 See [`FILEFORMAT`](FILEFORMAT.md) for a description of the test case file
196 test suite. To use it, configure curl with `CFLAGS='-fprofile-arcs
197 -ftest-coverage -g -O0'`. Make sure you run the normal and torture tests to
200 make test
201 make test-torture
206 ggcov -r lib src
214 machine where perl can not be run. The test framework in this case runs on
219 ## Test case numbering
221 Test cases used to be numbered by category ranges, but the ranges filled
229 Here's a quick description on writing test cases. We basically have three
230 kinds of tests: the ones that test the curl tool, the ones that build small
231 applications and test libcurl directly and the unit tests that test
234 ### test data
236 Each test has a master file that controls all the test data. What to read,
240 These files are `tests/data/test[num]` where `[num]` is just a unique
241 identifier described above, and the XML-like file format of them is
246 A test case that runs the curl tool and verifies that it gets the correct
253 specific and dedicated custom-built program to run instead of "curl". This
255 make a new libcurl test that is where you add your code.