]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test1140: compare stdout
authorDaniel Stenberg <daniel@haxx.se>
Fri, 14 Aug 2020 15:48:43 +0000 (17:48 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 14 Aug 2020 22:10:36 +0000 (00:10 +0200)
To make problems more immediately obvious when tests fail.

Closes #5814

tests/data/test1140
tests/nroff-scan.pl

index b9458be9ff58b9b4fd9864b7dc0d08fc34956ada..f083eec3911f41048abe15691b8bc417ae48ce09 100644 (file)
@@ -23,4 +23,10 @@ Verify the nroff of man pages
 </command>
 </client>
 
+<verify>
+<stdout>
+OK
+</stdout>
+</verify>
+
 </testcase>
index 3df778a73059fb59466ac1474274b7e47e2e9b10..15a59c9b01e0f81aedf905a4246b1427a35726fe 100755 (executable)
@@ -63,23 +63,23 @@ sub file {
         while($l =~ s/\\f(.)([^ ]*)\\f(.)//) {
             my ($pre, $str, $post)=($1, $2, $3);
             if($post ne "P") {
-                print STDERR "error: $f:$line: missing \\fP after $str\n";
+                print "error: $f:$line: missing \\fP after $str\n";
                 $errors++;
             }
             if($str =~ /((libcurl|curl)([^ ]*))\(3\)/i) {
                 my $man = "$1.3";
                 if(!manpresent($man)) {
-                    print STDERR "error: $f:$line: referring to non-existing man page $man\n";
+                    print "error: $f:$line: referring to non-existing man page $man\n";
                     $errors++;
                 }
                 if($pre ne "I") {
-                    print STDERR "error: $f:$line: use \\fI before $str\n";
+                    print "error: $f:$line: use \\fI before $str\n";
                     $errors++;
                 }
             }
         }
         if($l =~ /(curl([^ ]*)\(3\))/i) {
-            print STDERR "error: $f:$line: non-referencing $1\n";
+            print "error: $f:$line: non-referencing $1\n";
             $errors++;
         }
         if($l =~ /^\.BR (.*)/) {
@@ -87,7 +87,7 @@ sub file {
             while($i =~ s/((lib|)curl([^ ]*)) *\"\(3\)(,|) *\" *//i ) {
                 my $man = "$1.3";
                 if(!manpresent($man)) {
-                    print STDERR "error: $f:$line: referring to non-existing man page $man\n";
+                    print "error: $f:$line: referring to non-existing man page $man\n";
                     $errors++;
                 }
             }
@@ -101,4 +101,6 @@ foreach my $f (@f) {
     file($f);
 }
 
+print "OK\n" if(!$errors);
+
 exit $errors?1:0;