mirror of
https://github.com/curl/curl.git
synced 2026-05-30 07:07:30 +03:00
runtests.pl: support nonewline="yes" in client/stdin sections
This commit is contained in:
parent
8dac7be438
commit
51b0f09b5e
2 changed files with 11 additions and 1 deletions
|
|
@ -316,8 +316,11 @@ Variables are substituted on the contents of the file as in the <command>
|
|||
section.
|
||||
</file>
|
||||
|
||||
<stdin>
|
||||
<stdin [nonewline="yes"]>
|
||||
Pass this given data on stdin to the tool.
|
||||
|
||||
If 'nonewline' is set, we will cut off the trailing newline of this given data
|
||||
before comparing with the one actually received by the client
|
||||
</stdin>
|
||||
|
||||
</client>
|
||||
|
|
|
|||
|
|
@ -3175,6 +3175,13 @@ sub singletest {
|
|||
|
||||
if(@stdintest) {
|
||||
my $stdinfile="$LOGDIR/stdin-for-$testnum";
|
||||
|
||||
my %hash = getpartattr("client", "stdin");
|
||||
if($hash{'nonewline'}) {
|
||||
# cut off the final newline from the final line of the stdin data
|
||||
chomp($stdintest[$#stdintest]);
|
||||
}
|
||||
|
||||
writearray($stdinfile, \@stdintest);
|
||||
|
||||
$cmdargs .= " <$stdinfile";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue