]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
test1119: scan all public headers
authorDaniel Stenberg <daniel@haxx.se>
Tue, 20 Sep 2022 11:32:58 +0000 (13:32 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 22 Sep 2022 07:43:13 +0000 (09:43 +0200)
Previously this test only scanned a subset of the headers, which made us
accidentally miss symbols that were provided in the others. Now, the script
iterates over all headers present in include/curl.

Closes #9544

tests/symbol-scan.pl

index 92dc0f0ed11f7b6c81c5dda413dd853fa9797aa6..7d7e5fdbaa4a0fb1f2436c5971e37e9edaef4d0e 100755 (executable)
@@ -53,11 +53,6 @@ my $root=$ARGV[0] || ".";
 # need an include directory when building out-of-tree
 my $i = ($ARGV[1]) ? "-I$ARGV[1] " : '';
 
-my $h = "$root/include/curl/curl.h";
-my $mh = "$root/include/curl/multi.h";
-my $ua = "$root/include/curl/urlapi.h";
-my $hd = "$root/include/curl/header.h";
-
 my $verbose=0;
 my $summary=0;
 my $misses=0;
@@ -95,11 +90,19 @@ sub scanheader {
     close H;
 }
 
-scanenum($h);
-scanheader($h);
-scanheader($mh);
-scanheader($ua);
-scanheader($hd);
+sub scanallheaders {
+    my $d = "$root/include/curl";
+    opendir(my $dh, $d) ||
+        die "Can't opendir: $!";
+    my @headers = grep { /.h\z/ } readdir($dh);
+    closedir $dh;
+    foreach my $h (@headers) {
+        scanenum("$d/$h");
+        scanheader("$d/$h");
+    }
+}
+
+scanallheaders();
 
 open S, "<$root/docs/libcurl/symbols-in-versions";
 while(<S>) {