lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [diff] [blame^] | 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 | .TH runtests.pl 1 "May 05, 2017" "Curl 5.5.5" "runtests" |
| 24 | |
| 25 | .SH NAME |
| 26 | runtests.pl \- run one or more test cases |
| 27 | .SH SYNOPSIS |
| 28 | .B runtests.pl [options] [test number] [!test number] [key word] [!key word] |
| 29 | .SH DESCRIPTION |
| 30 | \fIruntests.pl\fP runs one, several or all the existing test cases in curl's |
| 31 | test suite. It is often called from the root Makefile of the curl package with |
| 32 | \&'make test'. |
| 33 | .SH "TEST NUMBER" |
| 34 | If no test case number is given, all existing tests that the script can find |
| 35 | will be considered for running. You can specify single test cases to run, |
| 36 | space-separated, like "1 3 5 7 11", and you can specify a range like "45 to |
| 37 | 67". You can also specify only the tests you don't want to run by listing |
| 38 | the numbers with a leading exclamation point, like "!66". |
| 39 | .P |
| 40 | It is also possible to specify tests to skip based on a key word describing |
| 41 | the test. These are specified with a leading exclamation point and the |
| 42 | key word or phrase, like "!HTTP NTLM auth". Likewise, tests to run can |
| 43 | be specified simply by specifying the unadorned key words, like "FTPS". |
| 44 | Remember that the exclamation marks and spaces will need to be quoted somehow |
| 45 | when entered at many command shells. |
| 46 | .SH OPTIONS |
| 47 | .IP "-a" |
| 48 | Continue running the rest of the test cases even if one test fails. By |
| 49 | default, the test script stops as soon as an error is detected. |
| 50 | .IP "-bN" |
| 51 | Use N as the base TCP/UDP port number on which to start the test servers. |
| 52 | .IP "-c <curl>" |
| 53 | Provide a path to a custom curl binary to run the tests with. Default is the |
| 54 | curl executable in the build tree. |
| 55 | .IP "-d" |
| 56 | Enable protocol debug: have the servers display protocol output. |
| 57 | .IP "-e" |
| 58 | Run the test event-based (if possible). This will make runtests invoke curl |
| 59 | with --test-event option. This option only works if both curl and libcurl were |
| 60 | built debug-enabled. |
| 61 | .IP "-g" |
| 62 | Run the given test(s) with gdb. This is best used on a single test case and |
| 63 | curl built --disable-shared. This then fires up gdb with command line set to |
| 64 | run the specified test case. Simply (set a break-point and) type 'run' to |
| 65 | start. |
| 66 | .IP "-h" |
| 67 | Displays a help text about this program's command line options. |
| 68 | .IP "-k" |
| 69 | Keep output and log files in log/ after a test run, even if no error was |
| 70 | detected. Useful for debugging. |
| 71 | .IP "-l" |
| 72 | Lists all test case names. |
| 73 | .IP "-n" |
| 74 | Disable the check for and use of valgrind. |
| 75 | .IP "-p" |
| 76 | Prints out all files in "log/" to stdout when a test case fails. Very |
| 77 | practical when used in the automated and distributed tests since then the |
| 78 | people checking the failures and the reasons for them might not have physical |
| 79 | access to the machine and logs. |
| 80 | .IP "-R" |
| 81 | Run the tests in a scrambled, or randomized, order instead of sequentially. |
| 82 | .IP "-r" |
| 83 | Display run time statistics. (Requires Perl Time::HiRes module) |
| 84 | .IP "-rf" |
| 85 | Display full run time statistics. (Requires Perl Time::HiRes module) |
| 86 | .IP "-s" |
| 87 | Shorter output. Speaks less than default. |
| 88 | .IP "-t[num]" |
| 89 | Selects a \fBtorture\fP test for the given tests. This makes runtests.pl first |
| 90 | run the tests once and count the number of memory allocations made. It then |
| 91 | reruns the test that number of times, each time forcing one of the allocations |
| 92 | to fail until all allocs have been tested. By setting \fInum\fP you can force |
| 93 | the allocation with that number to be set to fail at once instead of looping |
| 94 | through everyone, which is very handy when debugging and then often in |
| 95 | combination with \fI-g\fP. |
| 96 | .IP "-v" |
| 97 | Enable verbose output. Speaks more than default. |
| 98 | .IP "-vc <curl>" |
| 99 | Provide a path to a custom curl binary to run when verifying that the servers |
| 100 | running are indeed our test servers. Default is the curl executable in the |
| 101 | build tree. |
| 102 | .SH "RUNNING TESTS" |
| 103 | Many tests have conditions that must be met before the test case can run |
| 104 | fine. They could depend on built-in features in libcurl or features present in |
| 105 | the operating system or even in third-party libraries that curl may or may not |
| 106 | use. |
| 107 | .P |
| 108 | The test script checks most of these by itself to determine when it is |
| 109 | safe to attempt to run each test. Those which cannot be run due to |
| 110 | failed requirements will simply be skipped and listed at the completion |
| 111 | of all test cases. In some unusual configurations, the test script |
| 112 | cannot make the correct determination for all tests. In these cases, |
| 113 | the problematic tests can be skipped using the "!keyword" skip feature |
| 114 | documented earlier. |
| 115 | .SH "WRITING TESTS" |
| 116 | The simplest way to write test cases is to start with a similar existing test, |
| 117 | save it with a new number and then adjust it to fit. There's an attempt to |
| 118 | document the test case file format in the tests/FILEFORMAT. |