From 795b2431cbba61853071a6237a320fed2656bc16 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 28 Jun 2025 03:19:49 +0200 Subject: [PATCH] tests: move CURL_DISABLE_DEPRECATION from build to first.h --- tests/libtest/CMakeLists.txt | 2 +- tests/libtest/Makefile.am | 1 - tests/libtest/first.h | 1 + tests/tunit/CMakeLists.txt | 2 +- tests/tunit/Makefile.am | 1 - tests/unit/CMakeLists.txt | 2 +- tests/unit/Makefile.am | 2 +- 7 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/libtest/CMakeLists.txt b/tests/libtest/CMakeLists.txt index 885466e273..849bd66202 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_DISABLE_DEPRECATION") +target_compile_definitions(${BUNDLE} PRIVATE ${CURL_DEBUG_MACROS}) 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 1b5d04acbd..2e746a9631 100644 --- a/tests/libtest/Makefile.am +++ b/tests/libtest/Makefile.am @@ -58,7 +58,6 @@ endif if CURLDEBUG AM_CPPFLAGS += -DCURLDEBUG endif -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 7f97a6bcb3..a909290024 100644 --- a/tests/libtest/first.h +++ b/tests/libtest/first.h @@ -24,6 +24,7 @@ * ***************************************************************************/ #define CURL_NO_OLDIES +#define CURL_DISABLE_DEPRECATION /* 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 diff --git a/tests/tunit/CMakeLists.txt b/tests/tunit/CMakeLists.txt index ec7ac58944..b12e9c205f 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_DISABLE_DEPRECATION") +target_compile_definitions(${BUNDLE} PRIVATE ${CURL_DEBUG_MACROS}) 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 a0231ccb3e..219b7a1057 100644 --- a/tests/tunit/Makefile.am +++ b/tests/tunit/Makefile.am @@ -57,7 +57,6 @@ endif if CURLDEBUG AM_CPPFLAGS += -DCURLDEBUG endif -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 e6ff3da6e1..eb402257f3 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_DISABLE_DEPRECATION" "BUILDING_LIBCURL") +target_compile_definitions(${BUNDLE} PRIVATE ${CURL_DEBUG_MACROS} "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 b2143b6fe5..a83809595f 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_DISABLE_DEPRECATION -DBUILDING_LIBCURL +AM_CPPFLAGS += -DBUILDING_LIBCURL if BUILD_UNITTESTS $(BUNDLE).c: $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRST_C) $(TESTS_C)