From 96dcf337041fabb828b26ea90ddd55185ec7b069 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 28 Jun 2025 03:17:38 +0200 Subject: [PATCH] tests: move CURL_NO_OLDIES from build to first.h --- tests/client/CMakeLists.txt | 1 - tests/client/Makefile.am | 1 - tests/client/first.h | 2 ++ tests/libtest/CMakeLists.txt | 2 +- tests/libtest/Makefile.am | 2 +- tests/libtest/first.h | 2 ++ tests/server/CMakeLists.txt | 1 - tests/server/Makefile.am | 2 -- tests/server/first.h | 2 +- tests/tunit/CMakeLists.txt | 2 +- tests/tunit/Makefile.am | 2 +- tests/unit/CMakeLists.txt | 2 +- tests/unit/Makefile.am | 2 +- 13 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tests/client/CMakeLists.txt b/tests/client/CMakeLists.txt index f3704ca15e..4e550bcdd1 100644 --- a/tests/client/CMakeLists.txt +++ b/tests/client/CMakeLists.txt @@ -46,7 +46,6 @@ target_include_directories(${BUNDLE} PRIVATE "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h", curlx "${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources ) -target_compile_definitions(${BUNDLE} PRIVATE "CURL_NO_OLDIES") set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF C_CLANG_TIDY "") curl_add_clang_tidy_test_target("${BUNDLE}-clang-tidy" ${BUNDLE} ${FIRST_C} ${TESTS_C}) diff --git a/tests/client/Makefile.am b/tests/client/Makefile.am index 928ec5b943..650415fcdd 100644 --- a/tests/client/Makefile.am +++ b/tests/client/Makefile.am @@ -51,7 +51,6 @@ LIBS = $(BLANK_AT_MAKETIME) if USE_CPPFLAG_CURL_STATICLIB AM_CPPFLAGS += -DCURL_STATICLIB endif -AM_CPPFLAGS += -DCURL_NO_OLDIES if USE_CPPFLAG_CURL_STATICLIB curlx_c_lib = diff --git a/tests/client/first.h b/tests/client/first.h index 0785bc7460..3c6e5bfc22 100644 --- a/tests/client/first.h +++ b/tests/client/first.h @@ -23,6 +23,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ +#define CURL_NO_OLDIES + #include "curl_setup.h" typedef int (*entry_func_t)(int, char **); diff --git a/tests/libtest/CMakeLists.txt b/tests/libtest/CMakeLists.txt index bf5ebd0c0c..885466e273 100644 --- a/tests/libtest/CMakeLists.txt +++ b/tests/libtest/CMakeLists.txt @@ -55,7 +55,7 @@ target_include_directories(${BUNDLE} PRIVATE "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h", curlx "${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources ) -target_compile_definitions(${BUNDLE} PRIVATE ${CURL_DEBUG_MACROS} "CURL_NO_OLDIES" "CURL_DISABLE_DEPRECATION") +target_compile_definitions(${BUNDLE} PRIVATE ${CURL_DEBUG_MACROS} "CURL_DISABLE_DEPRECATION") set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF C_CLANG_TIDY "") curl_add_clang_tidy_test_target("${BUNDLE}-clang-tidy" ${BUNDLE} ${FIRST_C} ${UTILS_C} ${TESTS_C}) diff --git a/tests/libtest/Makefile.am b/tests/libtest/Makefile.am index ef953466ef..1b5d04acbd 100644 --- a/tests/libtest/Makefile.am +++ b/tests/libtest/Makefile.am @@ -58,7 +58,7 @@ endif if CURLDEBUG AM_CPPFLAGS += -DCURLDEBUG endif -AM_CPPFLAGS += -DCURL_NO_OLDIES -DCURL_DISABLE_DEPRECATION +AM_CPPFLAGS += -DCURL_DISABLE_DEPRECATION if USE_CPPFLAG_CURL_STATICLIB curlx_c_lib = diff --git a/tests/libtest/first.h b/tests/libtest/first.h index 24aefed9c6..7f97a6bcb3 100644 --- a/tests/libtest/first.h +++ b/tests/libtest/first.h @@ -23,6 +23,8 @@ * SPDX-License-Identifier: curl * ***************************************************************************/ +#define CURL_NO_OLDIES + /* Now include the curl_setup.h file from libcurl's private libdir (the source version, but that might include "curl_config.h" from the build dir so we need both of them in the include path), so that we get good in-depth diff --git a/tests/server/CMakeLists.txt b/tests/server/CMakeLists.txt index e3c27f43c0..15a5e975dc 100644 --- a/tests/server/CMakeLists.txt +++ b/tests/server/CMakeLists.txt @@ -42,7 +42,6 @@ target_include_directories(${BUNDLE} PRIVATE "${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h", curlx "${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources ) -target_compile_definitions(${BUNDLE} PRIVATE "CURL_NO_OLDIES") set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF C_CLANG_TIDY "") curl_add_clang_tidy_test_target("${BUNDLE}-clang-tidy" ${BUNDLE} ${FIRST_C} ${UTILS_C} ${TESTS_C}) diff --git a/tests/server/Makefile.am b/tests/server/Makefile.am index 0ba396a4b0..0751903a61 100644 --- a/tests/server/Makefile.am +++ b/tests/server/Makefile.am @@ -48,8 +48,6 @@ CFLAGS += @CURL_CFLAG_EXTRAS@ # Prevent LIBS from being used for all link targets LIBS = $(BLANK_AT_MAKETIME) -AM_CPPFLAGS += -DCURL_NO_OLDIES - $(BUNDLE).c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRST_C) $(UTILS_C) $(CURLX_C) $(TESTS_C) @PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS_C) $(CURLX_C) --test $(TESTS_C) > $(BUNDLE).c diff --git a/tests/server/first.h b/tests/server/first.h index f81e372c06..73e33f7d9b 100644 --- a/tests/server/first.h +++ b/tests/server/first.h @@ -34,8 +34,8 @@ #ifdef _WIN32 #define CURL_STATICLIB #endif - #define WITHOUT_LIBCURL +#define CURL_NO_OLDIES #include "curl_setup.h" diff --git a/tests/tunit/CMakeLists.txt b/tests/tunit/CMakeLists.txt index 65626b4911..ec7ac58944 100644 --- a/tests/tunit/CMakeLists.txt +++ b/tests/tunit/CMakeLists.txt @@ -44,7 +44,7 @@ target_include_directories(${BUNDLE} PRIVATE "${PROJECT_SOURCE_DIR}/tests/libtest" # for "first.h", "unitcheck.h" "${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources ) -target_compile_definitions(${BUNDLE} PRIVATE ${CURL_DEBUG_MACROS} "CURL_NO_OLDIES" "CURL_DISABLE_DEPRECATION") +target_compile_definitions(${BUNDLE} PRIVATE ${CURL_DEBUG_MACROS} "CURL_DISABLE_DEPRECATION") set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF C_CLANG_TIDY "") curl_add_clang_tidy_test_target("${BUNDLE}-clang-tidy" ${BUNDLE} ${FIRST_C} ${TESTS_C}) diff --git a/tests/tunit/Makefile.am b/tests/tunit/Makefile.am index 14a5baaece..a0231ccb3e 100644 --- a/tests/tunit/Makefile.am +++ b/tests/tunit/Makefile.am @@ -57,7 +57,7 @@ endif if CURLDEBUG AM_CPPFLAGS += -DCURLDEBUG endif -AM_CPPFLAGS += -DCURL_NO_OLDIES -DCURL_DISABLE_DEPRECATION +AM_CPPFLAGS += -DCURL_DISABLE_DEPRECATION if BUILD_UNITTESTS $(BUNDLE).c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRST_C) $(TESTS_C) diff --git a/tests/unit/CMakeLists.txt b/tests/unit/CMakeLists.txt index 62d429b719..e6ff3da6e1 100644 --- a/tests/unit/CMakeLists.txt +++ b/tests/unit/CMakeLists.txt @@ -45,7 +45,7 @@ target_include_directories(${BUNDLE} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources ) # unit tests are small pretend-libcurl-programs, pass BUILDING_LIBCURL to reflect that -target_compile_definitions(${BUNDLE} PRIVATE ${CURL_DEBUG_MACROS} "CURL_NO_OLDIES" "CURL_DISABLE_DEPRECATION" "BUILDING_LIBCURL") +target_compile_definitions(${BUNDLE} PRIVATE ${CURL_DEBUG_MACROS} "CURL_DISABLE_DEPRECATION" "BUILDING_LIBCURL") set_target_properties(${BUNDLE} PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}" UNITY_BUILD OFF C_CLANG_TIDY "") curl_add_clang_tidy_test_target("${BUNDLE}-clang-tidy" ${BUNDLE} ${FIRST_C} ${TESTS_C}) diff --git a/tests/unit/Makefile.am b/tests/unit/Makefile.am index 646ada3ccb..b2143b6fe5 100644 --- a/tests/unit/Makefile.am +++ b/tests/unit/Makefile.am @@ -57,7 +57,7 @@ if CURLDEBUG AM_CPPFLAGS += -DCURLDEBUG endif # unit tests are small pretend-libcurl-programs, pass BUILDING_LIBCURL to reflect that -AM_CPPFLAGS += -DCURL_NO_OLDIES -DCURL_DISABLE_DEPRECATION -DBUILDING_LIBCURL +AM_CPPFLAGS += -DCURL_DISABLE_DEPRECATION -DBUILDING_LIBCURL if BUILD_UNITTESTS $(BUNDLE).c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRST_C) $(TESTS_C)