mirror of
https://github.com/curl/curl.git
synced 2026-04-14 22:31:41 +03:00
runtests: allow client/command to span multiple lines, and use it
Some curl command-lines are long, often repetitive, and difficult to read or write: Before this patch (1 test == 1 line): - <=78 characters: 1099 tests - 79-132 characters: 500 tests - 133+ characters: 217 tests: patch meant to help with some of these. After this patch: - <=78 characters: 1288 lines - 79-132 characters: 526 lines - 133+ characters: 190 lines After this patch it's possible to fold long lines into multiple ones. Folding can reduce greppability, thus this is primarily useful for cases when the options are repetitive, e.g. a list of form options, headers, mail parameters and the like. Closes #19500
This commit is contained in:
parent
64c03bbdf2
commit
3d42510118
38 changed files with 233 additions and 39 deletions
|
|
@ -804,10 +804,13 @@ sub singletest_run {
|
|||
my ($testnum, $testtimings) = @_;
|
||||
|
||||
# get the command line options to use
|
||||
my ($cmd, @blaha)= getpart("client", "command");
|
||||
if($cmd) {
|
||||
# make some nice replace operations
|
||||
my $cmd;
|
||||
my @cmd = getpart("client", "command");
|
||||
if(@cmd) {
|
||||
# allow splitting the command-line to multiple lines
|
||||
$cmd = join(' ', @cmd);
|
||||
$cmd =~ s/\n//g; # no newlines please
|
||||
chomp $cmd; # no newlines please
|
||||
# substitute variables in the command line
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue