5 \___|\___/|_| \_\_____|
10 perl (and a unix-style shell)
11 diff (when a test fails, a diff is shown)
12 stunnel (for HTTPS and FTPS tests)
13 OpenSSH or SunSSH (for SCP, SFTP and SOCKS4/5 tests)
15 Ports used by default:
21 - TCP/8994 for HTTP IPv6
22 - TCP/8995 for FTP (2)
23 - TCP/8996 for FTP IPv6
25 - UDP/8998 for TFTP IPv6
26 - TCP/8999 for SCP/SFTP
32 The test suite runs simple FTP, POP3, IMAP, SMTP, HTTP and TFTP stand-alone
33 servers on these ports to which it makes requests. For SSL tests, it runs
34 stunnel to handle encryption to the regular servers. For SSH, it runs a
35 standard OpenSSH server. For SOCKS4/5 tests SSH is used to perform the SOCKS
36 functionality and requires a SSH client and server.
38 The base port number shown above can be changed using runtests' -b option
39 to allow running more than one instance of the test suite simultaneously
43 'make test'. This builds the test suite support code and invokes the
44 'runtests.pl' perl script to run all the tests. Edit the top variables
45 of that script in case you have some specific needs, or run the script
46 manually (after the support code has been built).
48 The script breaks on the first test that doesn't do OK. Use -a to prevent
49 the script from abort on the first error. Run the script with -v for more
50 verbose output. Use -d to run the test servers with debug output enabled as
51 well. Specifying -k keeps all the log files generated by the test intact.
53 Use -s for shorter output, or pass test numbers to run specific tests only
54 (like "./runtests.pl 3 4" to test 3 and 4 only). It also supports test case
55 ranges with 'to', as in "./runtests 3 to 9" which runs the seven tests from
56 3 to 9. Any test numbers starting with ! are disabled, as are any test
57 numbers found in the file data/DISABLED (one per line).
59 Shell startup scripts:
60 Tests which use the ssh test server, SCP/SFTP/SOCKS tests, might be badly
61 influenced by the output of system wide or user specific shell startup
62 scripts, .bashrc, .profile, /etc/csh.cshrc, .login, /etc/bashrc, etc. which
63 output text messages or escape sequences on user login. When these shell
64 startup messages or escape sequences are output they might corrupt the
65 expected stream of data which flows to the sftp-server or from the ssh
66 client which can result in bad test behaviour or even prevent the test
69 If the test suite ssh or sftp server fails to start up and logs the message
70 'Received message too long' then you are certainly suffering the unwanted
71 output of a shell startup script. Locate, cleanup or adjust the shell
75 The test script will check that all allocated memory is freed properly IF
76 curl has been built with the CURLDEBUG define set. The script will
77 automatically detect if that is the case, and it will use the ../memanalyze
78 script to analyze the memory debugging output.
80 The -t option will enable torture testing mode, which runs each test
81 many times but causes a different memory allocation to fail on each
82 successive run. This tests the out of memory error handling code to
83 ensure that memory leaks do not occur even in those situations.
86 If a test case fails, you can conveniently get the script to invoke the
87 debugger (gdb) for you with the server running and the exact same command
88 line parameters that failed. Just invoke 'runtests.pl <test number> -g' and
89 then just type 'run' in the debugger to perform the command through the
92 If a test case causes a core dump, analyze it by running gdb like:
94 # gdb ../curl/src core
96 ... and get a stack trace with the gdb command:
101 All logs are generated in the logs/ subdirectory (it is emptied first
102 in the runtests.pl script). Use runtests.pl -k to keep the temporary files
106 All test cases are put in the data/ subdirectory. Each test is stored in the
107 file named according to the test number.
109 See FILEFORMAT for the description of the test case files.
112 gcc provides a tool that can determine the code coverage figures for
113 the test suite. To use it, configure curl with
114 CFLAGS='-fprofile-arcs -ftest-coverage -g -O0'. Make sure you run the normal
115 and torture tests to get more full coverage, i.e. do:
120 The graphical tool ggcov can be used to browse the source and create
121 coverage reports on *NIX hosts:
125 The text mode tool gcov may also be used, but it doesn't handle object files
126 in more than one directory very well.
129 The runtests.pl script provides some hooks to allow curl to be tested on a
130 machine where perl can not be run. The test framework in this case runs on
131 a workstation where perl is available, while curl itself is run on a remote
132 system using ssh or some other remote execution method. See the comments at
133 the beginning of runtests.pl for details.
137 So far, we've used this system:
144 500 - 599 libcurl source code tests, not using the curl command tool
146 700 - 799 SOCKS4 (even numbers) and SOCK5 (odd numbers)
147 800 - 899 POP3, IMAP, SMTP
148 1000 - 1999 miscellaneous*
149 2000 - x multiple sequential protocols per test case*
151 Since 30-apr-2003, there's nothing in the system that requires us to keep
152 within these number series, and those sections marked with * actually
153 contain tests for a variety of protocols. Each test case now specifies
154 its own server requirements, independent of test number.
158 * Add tests for TELNET, LDAP, DICT...
159 * SOCKS4/5 test deficiencies - no proxy authentication tests as SSH (the
160 test mechanism) doesn't support them