mirror of
https://github.com/curl/curl.git
synced 2026-08-26 02:23:31 +03:00
lib: make CURLX_SET_BINMODE() and use it
Use it from libtests' `first.c` and thus also from units, and tunits. Also: - cmake: drop stray `curltool` lib dependency for units. - units: stop depending on `src` headers. - tests/server: drop depending on `src` headers. (the remaining one listed in the comments, `tool_xattr.h`, was not actually used from servers.) - tests/server: drop duplicate curlx headers. (Except `warnless.h`, which is tricky on Windows.) Closes #17672
This commit is contained in:
parent
35d0c047ce
commit
916f241f2f
18 changed files with 29 additions and 44 deletions
|
|
@ -54,7 +54,6 @@ target_include_directories(${BUNDLE} PRIVATE
|
|||
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
|
||||
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
|
||||
"${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx
|
||||
"${PROJECT_SOURCE_DIR}/src" # for "tool_binmode.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources
|
||||
"${PROJECT_SOURCE_DIR}/tests/unit" # for "curlcheck.h"
|
||||
)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
|
|||
-I$(top_builddir)/lib \
|
||||
-I$(top_srcdir)/lib \
|
||||
-I$(top_srcdir)/lib/curlx \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(srcdir) \
|
||||
-I$(top_srcdir)/tests/unit
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#include "memdebug.h"
|
||||
#include "curlx/timediff.h"
|
||||
#include "tool_binmode.h"
|
||||
#include "curlx/binmode.h"
|
||||
|
||||
int select_wrapper(int nfds, fd_set *rd, fd_set *wr, fd_set *exc,
|
||||
struct timeval *tv)
|
||||
|
|
@ -107,7 +107,7 @@ int main(int argc, char **argv)
|
|||
char *env;
|
||||
size_t tmp;
|
||||
|
||||
CURL_SET_BINMODE(stdout);
|
||||
CURLX_SET_BINMODE(stdout);
|
||||
|
||||
memory_tracking_init();
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,6 @@ target_include_directories(${BUNDLE} PRIVATE
|
|||
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
|
||||
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
|
||||
"${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx
|
||||
"${PROJECT_SOURCE_DIR}/src" # for "tool_binmode.h", "tool_xattr.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources
|
||||
)
|
||||
set_property(TARGET ${BUNDLE} APPEND PROPERTY COMPILE_DEFINITIONS "WITHOUT_LIBCURL")
|
||||
|
|
|
|||
|
|
@ -31,14 +31,12 @@ AUTOMAKE_OPTIONS = foreign nostdinc
|
|||
# $(top_srcdir)/include is for libcurl's external include files
|
||||
# $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
|
||||
# $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files
|
||||
# $(top_srcdir)/src for "tool_binmode.h", "tool_xattr.h"
|
||||
# $(srcdir) for the generated bundle source to find included test sources
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/include \
|
||||
-I$(top_builddir)/lib \
|
||||
-I$(top_srcdir)/lib \
|
||||
-I$(top_srcdir)/lib/curlx \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(srcdir)
|
||||
|
||||
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, CURLX_SRCS, TESTFILES variables
|
||||
|
|
|
|||
|
|
@ -55,8 +55,6 @@
|
|||
#include <curlx.h> /* from the private lib dir */
|
||||
#include "getpart.h"
|
||||
|
||||
#include "tool_binmode.h"
|
||||
|
||||
/* include memdebug.h last */
|
||||
#include <memdebug.h>
|
||||
|
||||
|
|
@ -985,9 +983,9 @@ static int test_mqttd(int argc, char *argv[])
|
|||
return 2;
|
||||
#endif
|
||||
|
||||
CURL_SET_BINMODE(stdin);
|
||||
CURL_SET_BINMODE(stdout);
|
||||
CURL_SET_BINMODE(stderr);
|
||||
CURLX_SET_BINMODE(stdin);
|
||||
CURLX_SET_BINMODE(stdout);
|
||||
CURLX_SET_BINMODE(stderr);
|
||||
|
||||
install_signal_handlers(FALSE);
|
||||
|
||||
|
|
|
|||
|
|
@ -102,12 +102,8 @@
|
|||
#endif
|
||||
|
||||
#include <curlx.h> /* from the private lib dir */
|
||||
#include "inet_pton.h"
|
||||
#include "timediff.h"
|
||||
#include "warnless.h" /* for read() */
|
||||
|
||||
#include "tool_binmode.h"
|
||||
|
||||
/* include memdebug.h last */
|
||||
#include <memdebug.h>
|
||||
|
||||
|
|
@ -1495,9 +1491,9 @@ static int test_sockfilt(int argc, char *argv[])
|
|||
return 2;
|
||||
#endif
|
||||
|
||||
CURL_SET_BINMODE(stdin);
|
||||
CURL_SET_BINMODE(stdout);
|
||||
CURL_SET_BINMODE(stderr);
|
||||
CURLX_SET_BINMODE(stdin);
|
||||
CURLX_SET_BINMODE(stdout);
|
||||
CURLX_SET_BINMODE(stderr);
|
||||
|
||||
install_signal_handlers(false);
|
||||
|
||||
|
|
|
|||
|
|
@ -74,8 +74,6 @@
|
|||
#endif
|
||||
|
||||
#include <curlx.h> /* from the private lib dir */
|
||||
#include "inet_pton.h"
|
||||
#include "tool_binmode.h"
|
||||
|
||||
/* include memdebug.h last */
|
||||
#include <memdebug.h>
|
||||
|
|
@ -1043,9 +1041,9 @@ static int test_socksd(int argc, char *argv[])
|
|||
return 2;
|
||||
#endif
|
||||
|
||||
CURL_SET_BINMODE(stdin);
|
||||
CURL_SET_BINMODE(stdout);
|
||||
CURL_SET_BINMODE(stderr);
|
||||
CURLX_SET_BINMODE(stdin);
|
||||
CURLX_SET_BINMODE(stdout);
|
||||
CURLX_SET_BINMODE(stderr);
|
||||
|
||||
install_signal_handlers(false);
|
||||
|
||||
|
|
|
|||
|
|
@ -51,7 +51,6 @@
|
|||
|
||||
#include <curlx.h> /* from the private lib dir */
|
||||
#include "getpart.h"
|
||||
#include "inet_pton.h"
|
||||
|
||||
/* include memdebug.h last */
|
||||
#include <memdebug.h>
|
||||
|
|
|
|||
|
|
@ -35,12 +35,11 @@ add_custom_command(OUTPUT "${BUNDLE_SRC}"
|
|||
|
||||
add_executable(${BUNDLE} EXCLUDE_FROM_ALL ${UTILS} "${BUNDLE_SRC}")
|
||||
add_dependencies(testdeps ${BUNDLE})
|
||||
target_link_libraries(${BUNDLE} curltool curlu)
|
||||
target_link_libraries(${BUNDLE} curlu)
|
||||
target_include_directories(${BUNDLE} PRIVATE
|
||||
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"
|
||||
"${PROJECT_SOURCE_DIR}/lib" # for "curl_setup.h"
|
||||
"${PROJECT_SOURCE_DIR}/lib/curlx" # for curlx
|
||||
"${PROJECT_SOURCE_DIR}/src" # for "tool_binmode.h"
|
||||
"${PROJECT_SOURCE_DIR}/tests/libtest" # for "first.h"
|
||||
"${CMAKE_CURRENT_SOURCE_DIR}" # for the generated bundle source to find included test sources
|
||||
)
|
||||
|
|
|
|||
|
|
@ -37,7 +37,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
|
|||
-I$(top_builddir)/lib \
|
||||
-I$(top_srcdir)/lib \
|
||||
-I$(top_srcdir)/lib/curlx \
|
||||
-I$(top_srcdir)/src \
|
||||
-I$(top_srcdir)/tests/libtest \
|
||||
-I$(srcdir)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue