From: Viktor Szakats Date: Thu, 10 Jul 2025 23:39:36 +0000 (+0200) Subject: test1222: fix for out-of-tree and no-libcurl-manual builds X-Git-Tag: curl-8_15_0~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=202f0752ea3fbe3c483800276ead5b2a4c24a556;p=thirdparty%2Fcurl.git 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 --- diff --git a/tests/data/test1222 b/tests/data/test1222 index b46fd11563..abb7d66186 100644 --- a/tests/data/test1222 +++ b/tests/data/test1222 @@ -17,7 +17,7 @@ Verify deprecation statuses and versions -%SRCDIR/test1222.pl %SRCDIR/.. +%SRCDIR/test1222.pl %SRCDIR/.. %PWD/.. diff --git a/tests/test1222.pl b/tests/test1222.pl index c1d37da444..0d9d6fdd32 100755 --- a/tests/test1222.pl +++ b/tests/test1222.pl @@ -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);