tests: move CURL_NO_OLDIES from build to first.h

This commit is contained in:
Viktor Szakats 2025-06-28 03:17:38 +02:00
parent 819f63679c
commit 96dcf33704
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
13 changed files with 11 additions and 12 deletions

View file

@ -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})

View file

@ -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 =

View file

@ -23,6 +23,8 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#define CURL_NO_OLDIES
#include "curl_setup.h"
typedef int (*entry_func_t)(int, char **);

View file

@ -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})

View file

@ -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 =

View file

@ -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

View file

@ -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})

View file

@ -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

View file

@ -34,8 +34,8 @@
#ifdef _WIN32
#define CURL_STATICLIB
#endif
#define WITHOUT_LIBCURL
#define CURL_NO_OLDIES
#include "curl_setup.h"

View file

@ -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})

View file

@ -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)

View file

@ -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})

View file

@ -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)