From: Daniel Stenberg Date: Sun, 2 Jan 2022 21:22:14 +0000 (+0100) Subject: runtests: allow client/file to specify multiple directories X-Git-Tag: curl-7_82_0~248 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4432234acaad3ecaf852b4c8a69c8fccc94ec512;p=thirdparty%2Fcurl.git runtests: allow client/file to specify multiple directories ... and make sure to mkdir them all --- diff --git a/tests/runtests.pl b/tests/runtests.pl index 066a91bf5c..ca82d09b2e 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'}) {