clarified the 0001-files use a bit, I couldn't understand it myself! :-)
[platform/upstream/curl.git] / tests / README
1                                   _   _ ____  _     
2                               ___| | | |  _ \| |    
3                              / __| | | | |_) | |    
4                             | (__| |_| |  _ <| |___ 
5                              \___|\___/|_| \_\_____|
6
7 The cURL Test Suite
8
9 Requires:
10   perl (and a unix-style shell)
11
12 Run:
13   'make test'. This invokes the 'runtests.pl' perl script. Edit the top
14   variables of that script in case you have some specific needs.
15
16   The script breaks on the first test that doesn't do OK. Use -a to prevent
17   the script to abort on the first error. Run the script with -v for more
18   verbose output. Use -d to run the test servers with debug output enabled as
19   well.
20
21   Use -s fort shorter output, or pass a string with test numbers to run
22   specific tests only (like ./runtests.pl "3 4" to test 3 and 4 only)
23
24 Memory:
25   The test script will check that all allocated memory is freed properly IF
26   curl has been built with the MALLOCDEBUG define set. The script will
27   automatically detect if that is the case, and it will use the ../memanalyze
28   script to analyze the memory debugging output.
29
30 Debug:
31   If a test case fails, you can conveniently get the script to invoke the
32   debugger (gdb) for you with the server running and the exact same command
33   line parameters that failed. Just invoke 'runtests.pl <test number> -g' and
34   then just type 'run' in the debugger to perform the command through the
35   debugger.
36
37   If a test case causes a core dump, analyze it by running gdb like:
38
39           # gdb ../curl/src core
40
41   ... and get a stack trace with the gdb command:
42
43           (gdb) where
44
45 Logs:
46   All logs are generated in the logs/ subdirctory (it is emtpied first
47   in the runtests.pl script)
48
49 Data:
50   All test-data are put in the data/ subdirctory.
51
52   For each tests there exist a few files, all with their own separate and
53   special purpose. Replace N with the test number:
54
55     nameN.txt: test description as displayed when run
56
57     commandN.txt: command line options for this test
58
59     protN.txt: the full dump of the protocol communication that curl is
60                expected to use when performing this test
61
62     replyN.txt: the full dump the server should reply to curl for this test.
63                If the final result that curl should've got is not in this
64                file, you can instead name the file replyN0001.txt. This
65                enables you to fiddle more. ;-) Alas, the server sends the
66                replyN.txt file but checks the result after the test against
67                the *0001.txt file.
68
69     stdoutN.txt: if this file is present, curl's stdout is compared against
70                this file to see that they're identical. If this is present,
71                curl will not be run with -o but instead all output is compared
72                against this file!
73
74     errorN.txt: if this file is present, it should contain the error number
75                curl is supposed to return when this test is run.
76
77     uploadN.txt: if this file is present, it should contain the same data as
78                the log/upload.N does, after a curl upload has been performed.
79
80     ftpdN.txt: this file may contain instructions how to modify the behaviour
81                of the ftp server. It uses a simple syntax that is left to
82                describe here!
83
84 TODO:
85
86   * Make httpserver.pl work when we PUT without Content-Length:
87   * Add persistant connection support and test cases