]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test1222: fix for out-of-tree and no-libcurl-manual builds
authorViktor Szakats <commit@vsz.me>
Thu, 10 Jul 2025 23:39:36 +0000 (01:39 +0200)
committerViktor Szakats <commit@vsz.me>
Fri, 11 Jul 2025 10:28:46 +0000 (12:28 +0200)
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

tests/data/test1222
tests/test1222.pl

index b46fd11563568bca90c7b6f9e8bb1cbb17d93a5f..abb7d66186e52fa4591f11c2deb2f7d9d9b0e527 100644 (file)
@@ -17,7 +17,7 @@ Verify deprecation statuses and versions
 </name>
 
 <command type="perl">
-%SRCDIR/test1222.pl %SRCDIR/..
+%SRCDIR/test1222.pl %SRCDIR/.. %PWD/..
 </command>
 </client>
 
index c1d37da444d42c36c392ec5fb426e42f7e8f39ab..0d9d6fdd32b99a58a4c26144932287bbc1cde5d1 100755 (executable)
@@ -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);