]> granicus.if.org Git - curl/commitdiff
runtests.pl: support nonewline="yes" in client/stdin sections
authorDaniel Stenberg <daniel@haxx.se>
Tue, 7 May 2013 20:51:59 +0000 (22:51 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 7 May 2013 20:52:43 +0000 (22:52 +0200)
tests/FILEFORMAT
tests/runtests.pl

index eeb4a9822b5325eff7c21cb9a4fb63348db8c68b..019137a559cfe166544bd8f90c4a3b269b376f21 100644 (file)
@@ -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>
index 809230ce54cd8fa7669bc62f14f2ba2e71fa75f0..96df8d5244b53f9cd4b1984d6b4490c0d23c7033 100755 (executable)
@@ -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";