1
0
mirror of https://github.com/moparisthebest/curl synced 2025-02-28 09:21:50 -05:00

test1140: compare stdout

To make problems more immediately obvious when tests fail.

Closes #5814
This commit is contained in:
Daniel Stenberg 2020-08-14 17:48:43 +02:00
parent d68fc02972
commit 86dc9867a5
No known key found for this signature in database
GPG Key ID: 5CC908FDB71E12C2
2 changed files with 13 additions and 5 deletions

View File

@ -23,4 +23,10 @@ Verify the nroff of man pages
</command> </command>
</client> </client>
<verify>
<stdout>
OK
</stdout>
</verify>
</testcase> </testcase>

View File

@ -63,23 +63,23 @@ sub file {
while($l =~ s/\\f(.)([^ ]*)\\f(.)//) { while($l =~ s/\\f(.)([^ ]*)\\f(.)//) {
my ($pre, $str, $post)=($1, $2, $3); my ($pre, $str, $post)=($1, $2, $3);
if($post ne "P") { if($post ne "P") {
print STDERR "error: $f:$line: missing \\fP after $str\n"; print "error: $f:$line: missing \\fP after $str\n";
$errors++; $errors++;
} }
if($str =~ /((libcurl|curl)([^ ]*))\(3\)/i) { if($str =~ /((libcurl|curl)([^ ]*))\(3\)/i) {
my $man = "$1.3"; my $man = "$1.3";
if(!manpresent($man)) { 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++; $errors++;
} }
if($pre ne "I") { if($pre ne "I") {
print STDERR "error: $f:$line: use \\fI before $str\n"; print "error: $f:$line: use \\fI before $str\n";
$errors++; $errors++;
} }
} }
} }
if($l =~ /(curl([^ ]*)\(3\))/i) { if($l =~ /(curl([^ ]*)\(3\))/i) {
print STDERR "error: $f:$line: non-referencing $1\n"; print "error: $f:$line: non-referencing $1\n";
$errors++; $errors++;
} }
if($l =~ /^\.BR (.*)/) { if($l =~ /^\.BR (.*)/) {
@ -87,7 +87,7 @@ sub file {
while($i =~ s/((lib|)curl([^ ]*)) *\"\(3\)(,|) *\" *//i ) { while($i =~ s/((lib|)curl([^ ]*)) *\"\(3\)(,|) *\" *//i ) {
my $man = "$1.3"; my $man = "$1.3";
if(!manpresent($man)) { 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++; $errors++;
} }
} }
@ -101,4 +101,6 @@ foreach my $f (@f) {
file($f); file($f);
} }
print "OK\n" if(!$errors);
exit $errors?1:0; exit $errors?1:0;