| 1 |
_ _ ____ _ |
| 2 |
___| | | | _ \| | |
| 3 |
/ __| | | | |_) | | |
| 4 |
| (__| |_| | _ <| |___ |
| 5 |
\___|\___/|_| \_\_____| |
| 6 |
|
| 7 |
The cURL Test Suite |
| 8 |
|
| 9 |
Requires: |
| 10 |
perl (and a unix-style shell) |
| 11 |
diff (when a test fail, a diff is shown) |
| 12 |
stunnel (for HTTPS and FTPS tests) |
| 13 |
|
| 14 |
TCP ports used: |
| 15 |
|
| 16 |
- 8999 on localhost for HTTP tests |
| 17 |
- 8433 on localhost for HTTPS tests |
| 18 |
- 8921 on localhost for FTP tests |
| 19 |
- 8821 on localhost for FTPS tests (currently disabled) |
| 20 |
|
| 21 |
The test suite runs simple FTP and HTTP servers on these ports to which |
| 22 |
it makes requests. |
| 23 |
|
| 24 |
Run: |
| 25 |
'make test'. This invokes the 'runtests.pl' perl script. Edit the top |
| 26 |
variables of that script in case you have some specific needs. |
| 27 |
|
| 28 |
The script breaks on the first test that doesn't do OK. Use -a to prevent |
| 29 |
the script to abort on the first error. Run the script with -v for more |
| 30 |
verbose output. Use -d to run the test servers with debug output enabled as |
| 31 |
well. |
| 32 |
|
| 33 |
Use -s for shorter output, or pass test numbers to run specific tests only |
| 34 |
(like "./runtests.pl 3 4" to test 3 and 4 only). It also supports test case |
| 35 |
ranges with 'to'. As in "./runtests 3 to 9" which runs the seven tests from |
| 36 |
3 to 9. |
| 37 |
|
| 38 |
Memory: |
| 39 |
The test script will check that all allocated memory is freed properly IF |
| 40 |
curl has been built with the CURLDEBUG define set. The script will |
| 41 |
automatically detect if that is the case, and it will use the ../memanalyze |
| 42 |
script to analyze the memory debugging output. |
| 43 |
|
| 44 |
Debug: |
| 45 |
If a test case fails, you can conveniently get the script to invoke the |
| 46 |
debugger (gdb) for you with the server running and the exact same command |
| 47 |
line parameters that failed. Just invoke 'runtests.pl <test number> -g' and |
| 48 |
then just type 'run' in the debugger to perform the command through the |
| 49 |
debugger. |
| 50 |
|
| 51 |
If a test case causes a core dump, analyze it by running gdb like: |
| 52 |
|
| 53 |
# gdb ../curl/src core |
| 54 |
|
| 55 |
... and get a stack trace with the gdb command: |
| 56 |
|
| 57 |
(gdb) where |
| 58 |
|
| 59 |
Logs: |
| 60 |
All logs are generated in the logs/ subdirctory (it is emptied first |
| 61 |
in the runtests.pl script). Use runtests.pl -k to keep the temporary files |
| 62 |
after the test run. |
| 63 |
|
| 64 |
Data: |
| 65 |
All test cases are put in the data/ subdirctory. Each test is stored in the |
| 66 |
file named according to the test number. |
| 67 |
|
| 68 |
See FILEFORMAT for the description of the test case files. |
| 69 |
|
| 70 |
|
| 71 |
TEST CASE NUMBERS |
| 72 |
|
| 73 |
So far, I've used this system: |
| 74 |
|
| 75 |
1 - 99 HTTP |
| 76 |
100 - 199 FTP |
| 77 |
200 - 299 FILE |
| 78 |
300 - 399 HTTPS |
| 79 |
400 - 499 FTPS |
| 80 |
500 - 599 libcurl source code tests, not using the curl command tool |
| 81 |
|
| 82 |
Since 30-apr-2003, there's nothing in the system that requires us to keep |
| 83 |
within these number series. Each test case now specifies its own server |
| 84 |
requirements, independent of test number. |
| 85 |
|
| 86 |
TODO: |
| 87 |
|
| 88 |
* Add tests for TELNET, GOPHER, LDAP, DICT... |