From: Daniel Stenberg Date: Tue, 7 May 2013 20:51:59 +0000 (+0200) Subject: runtests.pl: support nonewline="yes" in client/stdin sections X-Git-Tag: curl-7_31_0~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=51b0f09b5e2286d4e59996da5d8d8713535882d8;p=thirdparty%2Fcurl.git runtests.pl: support nonewline="yes" in client/stdin sections --- diff --git a/tests/FILEFORMAT b/tests/FILEFORMAT index eeb4a9822b..019137a559 100644 --- a/tests/FILEFORMAT +++ b/tests/FILEFORMAT @@ -316,8 +316,11 @@ Variables are substituted on the contents of the file as in the section. - + 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 diff --git a/tests/runtests.pl b/tests/runtests.pl index 809230ce54..96df8d5244 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -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";