diff options
-rw-r--r-- | tests/FILEFORMAT | 5 | ||||
-rwxr-xr-x | tests/runtests.pl | 7 |
2 files changed, 11 insertions, 1 deletions
diff --git a/tests/FILEFORMAT b/tests/FILEFORMAT index eeb4a9822..019137a55 100644 --- a/tests/FILEFORMAT +++ b/tests/FILEFORMAT @@ -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> diff --git a/tests/runtests.pl b/tests/runtests.pl index 809230ce5..96df8d524 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"; |