]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
runtests: support crlf="yes" for the <stderr> section
authorDaniel Stenberg <daniel@haxx.se>
Sun, 23 Jun 2024 14:22:40 +0000 (16:22 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 24 Jun 2024 06:43:40 +0000 (08:43 +0200)
tests/FILEFORMAT.md
tests/runtests.pl

index d4dd85b5ef867296ad30663d6741beb91b513a5c..928b5567b2e27545f08bc2c1f6e27791c9d538db 100644 (file)
@@ -627,12 +627,15 @@ server is used), if `nonewline` is set, we will cut off the trailing newline
 of this given data before comparing with the one actually sent by the client
 The `<strip>` and `<strippart>` rules are applied before comparisons are made.
 
-### `<stderr [mode="text"] [nonewline="yes"]>`
+### `<stderr [mode="text"] [nonewline="yes"] [crlf="yes"]>`
 This verifies that this data was passed to stderr.
 
 Use the mode="text" attribute if the output is in text mode on platforms that
 have a text/binary difference.
 
+`crlf=yes` forces the newlines to become CRLF even if not written so in the
+test.
+
 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
 
index 8839b1b3eb3dcdc3278a78ac0c88119e2fa55a11..03358da0017cc9be7cc8083a4d977404b701ccdd 100755 (executable)
@@ -1311,6 +1311,10 @@ sub singletest_check {
             chomp($validstderr[-1]);
         }
 
+        if($hash{'crlf'}) {
+            subnewlines(0, \$_) for @validstderr;
+        }
+
         $res = compare($runnerid, $testnum, $testname, "stderr", \@actual, \@validstderr);
         if($res) {
             return -1;