Allow multiple curl requests per test file

This could still do with some more work to allow clearing previous settings,
it does now allow repeated URL lines per test file.
This commit is contained in:
Andrew Ruthven 2024-04-22 01:28:58 +12:00
parent 1077714a83
commit 341707b045

View File

@ -377,24 +377,25 @@ exit(0);
sub run_curl {
my $url = shift;
push @arguments, @auth;
my @args = @arguments;
push @args, @auth;
if ( -f $datafile ) {
push @arguments, "--data-binary", "\@$datafile";
push @args, "--data-binary", "\@$datafile";
}
elsif ( defined($data_binary) ) {
push @arguments, "--data-binary", $data_binary;
push @args, "--data-binary", $data_binary;
}
else {
undef($datafile);
}
push @arguments, $url;
push @args, $url;
warn join " ", "curl", @arguments, "\n"
warn join " ", "curl", @args, "\n"
if $debug;
open RESULTS, "-|", "curl", @arguments;
open RESULTS, "-|", "curl", @args;
while ( <RESULTS> ) {
my $line = $_;