From: Daniel Stenberg Date: Sun, 27 Apr 2025 15:35:20 +0000 (+0200) Subject: buildinfo: move from tests/server/ to src/, rename to curlinfo X-Git-Tag: curl-8_14_0~186 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7a1211d474afd4e36bfb39f2b870a418bce42138;p=thirdparty%2Fcurl.git buildinfo: move from tests/server/ to src/, rename to curlinfo Since a16485a42ea5dabe6c, the test servers build with a different set of options than the tool/lib - for example a different CURLDEBUG. To make buildinfo better reflect the curl build, move it to src/ and build it here using the local CURLDEBUG. Renamed to curlinfo to not get confused with buildinfo.txt I chose src/ and not lib/ because the file also uses tool-specific headers. Assisted-by: Viktor Szakats Closes #17187 --- diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index e8f2815dc1..19f525abed 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -92,6 +92,12 @@ target_compile_definitions(${EXE_NAME} PRIVATE ${_curl_definitions}) add_executable(${PROJECT_NAME}::${EXE_NAME} ALIAS ${EXE_NAME}) +add_executable( + curlinfo + EXCLUDE_FROM_ALL + curlinfo.c +) + add_library( curltool # special libcurltool library just for unittests STATIC diff --git a/src/Makefile.am b/src/Makefile.am index f6df54ef76..af69d6ecf2 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -48,6 +48,9 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \ bin_PROGRAMS = curl +curlinfo_SOURCES = curlinfo.c +noinst_PROGRAMS = curlinfo + if USE_CPPFLAG_CURL_STATICLIB AM_CPPFLAGS += -DCURL_STATICLIB endif @@ -60,7 +63,7 @@ endif AM_LDFLAGS = if USE_UNICODE -AM_LDFLAGS += -municode +UNICODEFLAG = -municode endif include Makefile.inc @@ -90,7 +93,7 @@ curl_SOURCES += $(CURL_RCFILES) $(CURL_RCFILES): tool_version.h endif -curl_LDFLAGS = $(AM_LDFLAGS) $(CURL_LDFLAGS_BIN) +curl_LDFLAGS = $(AM_LDFLAGS) $(CURL_LDFLAGS_BIN) $(UNICODEFLAG) # This might hold -Werror CFLAGS += @CURL_CFLAG_EXTRAS@ diff --git a/tests/server/buildinfo.c b/src/curlinfo.c similarity index 98% rename from tests/server/buildinfo.c rename to src/curlinfo.c index 9f5af56287..3c8aa62df2 100644 --- a/tests/server/buildinfo.c +++ b/src/curlinfo.c @@ -24,7 +24,7 @@ /* * The purpose of this tool is to figure out which, if any, features that are - * disabled which should otherwise exist and work. These aren't visible in + * disabled which should otherwise exist and work. These are not visible in * regular curl -V output. * * Disabled protocols are visible in curl_version_info() and are not included diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5fb7b764b0..11736d1cd6 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -30,6 +30,10 @@ mark_as_advanced(TEST_NGHTTPX) configure_file("config.in" "${CMAKE_CURRENT_BINARY_DIR}/config" @ONLY) add_custom_target(testdeps) +if(BUILD_CURL_EXE) + add_dependencies(testdeps curlinfo) +endif() + add_subdirectory(http) add_subdirectory(http/clients) add_subdirectory(server) diff --git a/tests/globalconfig.pm b/tests/globalconfig.pm index 3b77406fa0..5f7f413637 100644 --- a/tests/globalconfig.pm +++ b/tests/globalconfig.pm @@ -37,6 +37,7 @@ BEGIN { $anyway $automakestyle $CURL + $CURLINFO $CURLVERSION $CURLVERNUM $DATE @@ -114,7 +115,11 @@ our $UNITDIR=dirsepadd("./unit/" . ($ENV{'CURL_DIRSUFFIX'} || '')); our $TUNITDIR=dirsepadd("./tunit/" . ($ENV{'CURL_DIRSUFFIX'} || '')); our $SRVDIR=dirsepadd("./server/" . ($ENV{'CURL_DIRSUFFIX'} || '')); our $TESTDIR="$srcdir/data"; -our $CURL=dirsepadd("../src/" . ($ENV{'CURL_DIRSUFFIX'} || '')) . "curl".exe_ext('TOOL'); # what curl binary to run on the tests +our $CURL=dirsepadd("../src/" . ($ENV{'CURL_DIRSUFFIX'} || '')) . + "curl".exe_ext('TOOL'); # what curl binary to run on the tests +our $CURLINFO=dirsepadd("../src/" . ($ENV{'CURL_DIRSUFFIX'} || '')) . + "curlinfo".exe_ext('TOOL'); # what curlinfo binary to run on the tests + our $VCURL=$CURL; # what curl binary to use to verify the servers with # VCURL is handy to set to the system one when the one you # just built hangs or crashes and thus prevent verification diff --git a/tests/runtests.pl b/tests/runtests.pl index 6aa0b54973..4e92f03d41 100755 --- a/tests/runtests.pl +++ b/tests/runtests.pl @@ -518,7 +518,7 @@ sub checksystemfeatures { @version = <$versout>; close($versout); - open(my $disabledh, "-|", server_exe('buildinfo', 'TOOL')); + open(my $disabledh, "-|", exerunner() . shell_quote($CURLINFO)); while(<$disabledh>) { if($_ =~ /([^:]*): ([ONF]*)/) { my ($val, $toggle) = ($1, $2); diff --git a/tests/server/Makefile.inc b/tests/server/Makefile.inc index 17a7816db1..8a22e483b7 100644 --- a/tests/server/Makefile.inc +++ b/tests/server/Makefile.inc @@ -22,7 +22,7 @@ # ########################################################################### -SERVERPROGS = resolve rtspd sockfilt sws tftpd socksd buildinfo mqttd dnsd +SERVERPROGS = resolve rtspd sockfilt sws tftpd socksd mqttd dnsd MEMDEBUG = \ ../../lib/memdebug.c \ @@ -122,5 +122,3 @@ dnsd_SOURCES = $(MEMDEBUG) $(CURLX_SRCS) $(CURLX_HDRS) $(UTIL) \ dnsd.c dnsd_LDADD = @CURL_NETWORK_AND_TIME_LIBS@ dnsd_CFLAGS = $(AM_CFLAGS) - -buildinfo_SOURCES = buildinfo.c diff --git a/tests/test1165.pl b/tests/test1165.pl index 621a93537e..61fe5c184d 100755 --- a/tests/test1165.pl +++ b/tests/test1165.pl @@ -87,13 +87,18 @@ sub scan_cmake_config_h { scanconf_cmake(\%disable_cmake_config_h, "$root/lib/curl_config.h.cmake"); } +my %whitelisted = ("CURL_DISABLE_TYPECHECK" => 1); + sub scan_file { my ($source)=@_; open F, "<$source"; while() { while(s/(CURL_DISABLE_[A-Z0-9_]+)//) { my ($sym)=($1); - $file{$sym} = $source; + + if(!$whitelisted{$sym}) { + $file{$sym} = $source; + } } } close F;