diff options
author | Daniel Stenberg <daniel@haxx.se> | 2022-01-02 22:22:14 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2022-01-07 10:08:35 +0100 |
commit | 4432234acaad3ecaf852b4c8a69c8fccc94ec512 (patch) | |
tree | 588d93db50b43797248aa7f988cc0fcfaf57ae2a /tests/runtests.pl | |
parent | 2e6f83f051edd36f2a87fe6c80e2817fcadbbc8c (diff) | |
download | curl-4432234acaad3ecaf852b4c8a69c8fccc94ec512.tar.gz |
runtests: allow client/file to specify multiple directories
... and make sure to mkdir them all
Diffstat (limited to 'tests/runtests.pl')
-rwxr-xr-x | tests/runtests.pl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/runtests.pl b/tests/runtests.pl index 066a91bf5..ca82d09b2 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -3976,6 +3976,20 @@ sub singletest { return -1; } my $fileContent = join('', @inputfile); + + # make directories if needed + my $path = $filename; + # cut off the file name part + $path =~ s/^(.*)\/[^\/]*/$1/; + my @parts = split(/\//, $path); + if($parts[0] eq "log") { + # the file is in log/ + my $d = shift @parts; + for(@parts) { + $d .= "/$_"; + mkdir $d; # 0777 + } + } open(OUTFILE, ">$filename"); binmode OUTFILE; # for crapage systems, use binary if($fileattr{'nonewline'}) { |