From 4432234acaad3ecaf852b4c8a69c8fccc94ec512 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 2 Jan 2022 22:22:14 +0100 Subject: [PATCH] runtests: allow client/file to specify multiple directories ... and make sure to mkdir them all --- tests/runtests.pl | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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'}) { -- 2.47.3