]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests/buildinfo: former "disabled" now provides more info
authorDaniel Stenberg <daniel@haxx.se>
Fri, 25 Apr 2025 06:16:13 +0000 (08:16 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 25 Apr 2025 07:43:47 +0000 (09:43 +0200)
This tool now contains ON/OFF information about features in the build.
This way, runtests gets both positive and negative feature presence with
this. Allows for more flexibility and avoids having to duplicate the
names.

Closes #17180

tests/runtests.pl
tests/server/.gitignore
tests/server/Makefile.inc
tests/server/buildinfo.c [moved from tests/server/disabled.c with 65% similarity]

index fde25538eedde73397508c1475ed4e99741dbc02..7c4f43ae544ac574e5bd46e979f622464b04ebdb 100755 (executable)
@@ -518,8 +518,14 @@ sub checksystemfeatures {
     @version = <$versout>;
     close($versout);
 
-    open(my $disabledh, "-|", server_exe('disabled', 'TOOL'));
-    @disabled = <$disabledh>;
+    open(my $disabledh, "-|", server_exe('buildinfo', 'TOOL'));
+    while(<$disabledh>) {
+        if($_ =~ /([^:]*): ([ONF]*)/) {
+            my ($val, $toggle) = ($1, $2);
+            push @disabled, $val if($toggle eq "OFF");
+            $feature{$val} = 1 if($toggle eq "ON");
+        }
+    }
     close($disabledh);
 
     if($disabled[0]) {
@@ -812,29 +818,8 @@ sub checksystemfeatures {
     $feature{"nghttpx"} = !!$ENV{'NGHTTPX'};
     $feature{"nghttpx-h3"} = !!$nghttpx_h3;
 
-    #
-    # strings that must exactly match the names used in server/disabled.c
-    #
-    $feature{"cookies"} = 1;
     # Use this as a proxy for any cryptographic authentication
     $feature{"crypto"} = $feature{"NTLM"} || $feature{"Kerberos"} || $feature{"SPNEGO"};
-    $feature{"DoH"} = 1;
-    $feature{"HTTP-auth"} = 1;
-    $feature{"Mime"} = 1;
-    $feature{"form-api"} = 1;
-    $feature{"netrc"} = 1;
-    $feature{"parsedate"} = 1;
-    $feature{"proxy"} = 1;
-    $feature{"shuffle-dns"} = 1;
-    $feature{"typecheck"} = 1;
-    $feature{"verbose-strings"} = 1;
-    $feature{"wakeup"} = 1;
-    $feature{"headers-api"} = 1;
-    $feature{"xattr"} = 1;
-    $feature{"large-time"} = 1;
-    $feature{"large-size"} = 1;
-    $feature{"sha512-256"} = 1;
-    $feature{"--libcurl"} = 1;
     $feature{"local-http"} = servers::localhttp();
     $feature{"codeset-utf8"} = lc(langinfo(CODESET())) eq "utf-8";
 
@@ -902,10 +887,6 @@ sub checksystemfeatures {
     # Disable memory tracking when using threaded resolver
     $feature{"TrackMemory"} = $feature{"TrackMemory"} && !$feature{"threaded-resolver"};
 
-    # toggle off the features that were disabled in the build
-    for my $d(@disabled) {
-        $feature{$d} = 0;
-    }
 }
 
 #######################################################################
index e4738eb8881c854a15ecffe52270108859870497..a369993cd06721977fcc80a8e28f0037593777cf 100644 (file)
@@ -4,8 +4,7 @@
 
 server_bundle.c
 servers
-
-disabled
+buildinfo
 mqttd
 resolve
 rtspd
index 3d36c137f02ef4f59c68fb6e7a7a83c657592828..17a7816db10b04b9f5325e1d664df92832b99e31 100644 (file)
@@ -22,7 +22,7 @@
 #
 ###########################################################################
 
-SERVERPROGS = resolve rtspd sockfilt sws tftpd socksd disabled mqttd dnsd
+SERVERPROGS = resolve rtspd sockfilt sws tftpd socksd buildinfo mqttd dnsd
 
 MEMDEBUG = \
   ../../lib/memdebug.c \
@@ -123,4 +123,4 @@ dnsd_SOURCES = $(MEMDEBUG) $(CURLX_SRCS) $(CURLX_HDRS) $(UTIL) \
 dnsd_LDADD = @CURL_NETWORK_AND_TIME_LIBS@
 dnsd_CFLAGS = $(AM_CFLAGS)
 
-disabled_SOURCES = disabled.c
+buildinfo_SOURCES = buildinfo.c
similarity index 65%
rename from tests/server/disabled.c
rename to tests/server/buildinfo.c
index 6d8fe5e42ad1a5eca1b63a546f51fa8873ffcaee..9f5af562874af94d5a38562d6bb7f195e50417cc 100644 (file)
 #include <stdio.h>
 
 static const char *disabled[]={
+  "bindlocal: "
 #ifdef CURL_DISABLE_BINDLOCAL
-  "bindlocal",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+
+  "cookies: "
 #ifdef CURL_DISABLE_COOKIES
-  "cookies",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+
+  "basic-auth: "
 #ifdef CURL_DISABLE_BASIC_AUTH
-  "basic-auth",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "bearer-auth: "
 #ifdef CURL_DISABLE_BEARER_AUTH
-  "bearer-auth",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "digest-auth: "
 #ifdef CURL_DISABLE_DIGEST_AUTH
-  "digest-auth",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "negotiate-auth: "
 #ifdef CURL_DISABLE_NEGOTIATE_AUTH
-  "negotiate-auth",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "aws: "
 #ifdef CURL_DISABLE_AWS
-  "aws",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "DoH: "
 #ifdef CURL_DISABLE_DOH
-  "DoH",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "HTTP-auth: "
 #ifdef CURL_DISABLE_HTTP_AUTH
-  "HTTP-auth",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "Mime: "
 #ifdef CURL_DISABLE_MIME
-  "Mime",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+
+  "netrc: "
 #ifdef CURL_DISABLE_NETRC
-  "netrc",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "parsedate: "
 #ifdef CURL_DISABLE_PARSEDATE
-  "parsedate",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "proxy: "
 #ifdef CURL_DISABLE_PROXY
-  "proxy",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "shuffle-dns: "
 #ifdef CURL_DISABLE_SHUFFLE_DNS
-  "shuffle-dns",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "typecheck: "
 #ifdef CURL_DISABLE_TYPECHECK
-  "typecheck",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "verbose-strings: "
 #ifdef CURL_DISABLE_VERBOSE_STRINGS
-  "verbose-strings",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "wakeup: "
 #ifndef ENABLE_WAKEUP
-  "wakeup",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "headers-api: "
 #ifdef CURL_DISABLE_HEADERS_API
-  "headers-api",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "xattr: "
 #ifndef USE_XATTR
-  "xattr",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "form-api: "
 #ifdef CURL_DISABLE_FORM_API
-  "form-api",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "large-time: "
 #if (SIZEOF_TIME_T < 5)
-  "large-time",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "large-size: "
 #if (SIZEOF_SIZE_T < 5)
-  "large-size",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+  "sha512-256: "
 #ifndef CURL_HAVE_SHA512_256
-  "sha512-256",
-#endif
-#ifdef _WIN32
-#if defined(CURL_WINDOWS_UWP) || \
-  defined(CURL_DISABLE_CA_SEARCH) || defined(CURL_CA_SEARCH_SAFE)
-  "win32-ca-searchpath",
-#endif
-#ifndef CURL_CA_SEARCH_SAFE
-  "win32-ca-search-safe",
-#endif
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
+
+  "win32-ca-searchpath: "
+#if !defined(_WIN32) ||                                                 \
+  (defined(CURL_WINDOWS_UWP) ||                                         \
+   defined(CURL_DISABLE_CA_SEARCH) || defined(CURL_CA_SEARCH_SAFE))
+  "OFF"
+#else
+  "ON"
+#endif
+  ,
+  "win32-ca-search-safe: "
+#if !defined(_WIN32) || !defined(CURL_CA_SEARCH_SAFE)
+  "OFF"
+#else
+  "ON"
+#endif
+  ,
+
+  "--libcurl: "
 #ifdef CURL_DISABLE_LIBCURL_OPTION
-  "--libcurl",
+  "OFF"
+#else
+  "ON"
 #endif
+  ,
   NULL
 };