mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
test1222: fix for out-of-tree and no-libcurl-manual builds
Before this patch this test succeeded silently and unconditionally, when run on an out-of-tree curl build. Also fix to exit gracefully if no libcurl manuals are found. Fixing: ``` readline() on closed filehandle $m at ../../tests/test1222.pl line 153. ``` Cherry-picked from #17877 Closes #17892
This commit is contained in:
parent
55509b045b
commit
202f0752ea
@ -17,7 +17,7 @@ Verify deprecation statuses and versions
|
||||
</name>
|
||||
|
||||
<command type="perl">
|
||||
%SRCDIR/test1222.pl %SRCDIR/..
|
||||
%SRCDIR/test1222.pl %SRCDIR/.. %PWD/..
|
||||
</command>
|
||||
</client>
|
||||
|
||||
|
||||
@ -32,10 +32,13 @@ use warnings;
|
||||
|
||||
use File::Basename;
|
||||
|
||||
my $root=$ARGV[0] || ".";
|
||||
my $root = $ARGV[0] || ".";
|
||||
my $bldroot = $ARGV[1] || ".";
|
||||
|
||||
my $incdir = "$root/include/curl";
|
||||
my $docdir = "$root/docs";
|
||||
my $docdir = "$bldroot/docs";
|
||||
my $libdocdir = "$docdir/libcurl";
|
||||
|
||||
my $errcode = 0;
|
||||
|
||||
# Symbol-indexed hashes.
|
||||
@ -237,8 +240,8 @@ sub scan_man_page {
|
||||
|
||||
|
||||
# Read symbols-in-versions.
|
||||
open(my $fh, "<", "$libdocdir/symbols-in-versions") ||
|
||||
die "$libdocdir/symbols-in-versions";
|
||||
open(my $fh, "<", "$root/docs/libcurl/symbols-in-versions") ||
|
||||
die "$root/docs/libcurl/symbols-in-versions";
|
||||
while(<$fh>) {
|
||||
if($_ =~ /^((?:CURL|LIBCURL)\S+)\s+\S+\s*(\S*)\s*(\S*)$/) {
|
||||
if($3 eq "") {
|
||||
@ -251,6 +254,11 @@ while(<$fh>) {
|
||||
}
|
||||
close($fh);
|
||||
|
||||
if(!glob("$libdocdir/*.3")) {
|
||||
print "curl built without the libcurl manual. Skipping test 1222.\n";
|
||||
exit 0;
|
||||
}
|
||||
|
||||
# Get header file names,
|
||||
opendir(my $dh, $incdir) || die "Can't opendir $incdir";
|
||||
my @hfiles = grep { /\.h$/ } readdir($dh);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user