tests: always make bundles, adapt build and tests

Make test bundles the default. Drop non-bundle build mode.
Also do all the optimizations and tidy-ups this allows, simpler builds,
less bundle exceptions, streamlined build mechanics.

Also rework the init/deinit macro magic for unit tests. The new method
allows using unique init/deinit function names, and calling them with
arguments. This is in turn makes it possible to reduce the use of global
variables.

Note this drop existing build options `-DCURL_TEST_BUNDLES=` from cmake
and `--enable-test-bundles` / `--disable-test-bundles` from autotools.

Also:
- rename test entry functions to have unique names: `test_<testname>`
  This removes the last exception that was handled in the generator.
- fix `make dist` to not miss test sources with test bundles enabled.
- sync and merge `tests/mk-bundle.pl` into `scripts/mk-unity.pl`.
- mk-unity.pl: add `--embed` option and use it when `CURL_CLANG_TIDY=ON`
  to ensure that `clang-tidy` does not miss external test C sources.
  (because `clang-tidy` ignores code that's #included.)
- tests/unit: drop no-op setup/stop functions.
- tests: reduce symbol scopes, global macros, other fixes and tidy-ups.
- tool1621: fix to run, also fix it to pass.
- sockfilt: fix Windows compiler warning in certain unity include order,
  by explicitly including `warnless.h`.

Follow-up to 6897aeb105 #17468

Closes #17590
This commit is contained in:
Viktor Szakats
2025-06-11 11:31:14 +02:00
parent 1cdac95e2e
commit 2c27a67daa
386 changed files with 2996 additions and 4164 deletions

View File

@@ -468,10 +468,10 @@ jobs:
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja \
-DCMAKE_C_COMPILER_TARGET="$(uname -m)-pc-linux-gnu" -DBUILD_STATIC_LIBS=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
${MATRIX_GENERATE}
else
mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking \
${MATRIX_CONFIGURE}
fi

View File

@@ -82,7 +82,7 @@ jobs:
run: |
mkdir bld-1
cd bld-1
cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DENABLE_ARES=OFF -DCURL_ZSTD=OFF -DCURL_USE_GSSAPI=OFF -DCURL_USE_LIBSSH2=ON -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON
make install
src/curl --disable --version
@@ -98,7 +98,7 @@ jobs:
run: |
mkdir bld-cares
cd bld-cares
cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
cmake .. -DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON -DBUILD_SHARED_LIBS=ON \
-DENABLE_ARES=ON -DCURL_USE_GSSAPI=ON -DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=OFF -DUSE_LIBRTMP=ON \
-DCURL_LIBCURL_VERSIONED_SYMBOLS=ON
@@ -128,7 +128,7 @@ jobs:
run: |
mkdir bld-am
cd bld-am
../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \
--with-openssl --enable-ares --with-libssh2 --with-zstd --with-gssapi --with-librtmp \
--prefix="$PWD"/../curl-install-am

View File

@@ -573,12 +573,12 @@ jobs:
cmake -B bld -G Ninja \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_C_COMPILER_TARGET="$(uname -m)-pc-linux-gnu" -DBUILD_STATIC_LIBS=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
${MATRIX_GENERATE}
else
mkdir bld && cd bld && \
${MATRIX_CONFIGURE_PREFIX} \
../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking \
${MATRIX_CONFIGURE}
fi

View File

@@ -236,7 +236,7 @@ jobs:
[ "${_chkprefill}" = '_chkprefill' ] && options+=' -D_CURL_PREFILL=OFF'
cmake -B "bld${_chkprefill}" -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
-DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
${MATRIX_GENERATE} ${options}
@@ -256,7 +256,7 @@ jobs:
fi
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && CFLAGS+=" -mmacosx-version-min=${MATRIX_MACOS_VERSION_MIN}"
[[ "${MATRIX_INSTALL_STEPS}" = *'pytest'* ]] && options+=' --with-test-vsftpd=no' # Skip ~20 tests that stretch run time by 7x on macOS
mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking \
--with-libpsl=/opt/homebrew/opt/libpsl \
${MATRIX_CONFIGURE} ${options}
@@ -458,7 +458,7 @@ jobs:
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && options+=" -DCMAKE_OSX_DEPLOYMENT_TARGET=${MATRIX_MACOS_VERSION_MIN}"
# would pick up nghttp2, libidn2, and libssh2
cmake -B bld -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
-DCMAKE_OSX_SYSROOT="${sysroot}" \
-DCMAKE_C_COMPILER_TARGET="$(uname -m | sed 's/arm64/aarch64/')-apple-darwin$(uname -r)" \
-DCMAKE_IGNORE_PREFIX_PATH="$(brew --prefix)" \
@@ -478,7 +478,7 @@ jobs:
fi
[ -n "${MATRIX_MACOS_VERSION_MIN}" ] && CFLAGS+=" -mmacosx-version-min=${MATRIX_MACOS_VERSION_MIN}"
# would pick up nghttp2, libidn2, but libssh2 is disabled by default
mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking \
--disable-docs --disable-manual \
--with-openssl="$(brew --prefix openssl)" \

View File

@@ -64,7 +64,7 @@ jobs:
time sudo pkgin -y install cmake ninja-build pkg-config perl brotli heimdal openldap-client libssh2 libidn2 libpsl nghttp2 py311-impacket
time cmake -B bld -G Ninja \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \
@@ -110,7 +110,7 @@ jobs:
time sudo pkg_add cmake ninja brotli openldap-client-- libssh2 libidn2 libpsl nghttp2 py3-six py3-impacket
time cmake -B bld -G Ninja \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \
@@ -137,7 +137,7 @@ jobs:
matrix:
include:
- { build: 'autotools', arch: 'x86_64', compiler: 'clang' }
- { build: 'cmake' , arch: 'x86_64', compiler: 'clang', options: '-DCMAKE_UNITY_BUILD=OFF -DCURL_TEST_BUNDLES=OFF', desc: ' !unity !bundle !runtests !examples' }
- { build: 'cmake' , arch: 'x86_64', compiler: 'clang', options: '-DCMAKE_UNITY_BUILD=OFF', desc: ' !unity !runtests !examples' }
- { build: 'autotools', arch: 'arm64', compiler: 'clang' }
- { build: 'cmake' , arch: 'arm64', compiler: 'clang' }
fail-fast: false
@@ -175,7 +175,7 @@ jobs:
time cmake -B bld -G Ninja \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_C_COMPILER="${CC}" \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DENABLE_DEBUG=ON -DCMAKE_BUILD_TYPE=Debug \
-DCURL_USE_OPENSSL=ON \
@@ -188,7 +188,7 @@ jobs:
options='--disable-manual --disable-docs' # Slow with autotools, skip on emulated CPU
fi
mkdir bld && cd bld
time ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \
time ../configure --enable-unity --enable-debug --enable-warnings --enable-werror \
--prefix="$HOME"/curl-install \
--with-openssl \
--with-brotli --enable-ldap --enable-ldaps --with-libidn2 --with-libssh2 --with-nghttp2 --with-gssapi \
@@ -258,7 +258,7 @@ jobs:
export CURL_CI=github
time autoreconf -fi
mkdir bld && cd bld
time ../configure --enable-unity --enable-test-bundles --enable-debug --enable-warnings --enable-werror \
time ../configure --enable-unity --enable-debug --enable-warnings --enable-werror \
--prefix="$HOME"/curl-install \
--with-openssl \
--disable-dependency-tracking \
@@ -378,12 +378,12 @@ jobs:
# https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-ios-tvos-visionos-or-watchos
[ -n "${MATRIX_GENERATOR}" ] && options="-G ${MATRIX_GENERATOR}"
cmake -B bld -G Ninja -D_CURL_PREFILL=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON -DCURL_WERROR=ON \
-DCMAKE_UNITY_BUILD=ON -DCURL_WERROR=ON \
-DCMAKE_SYSTEM_NAME=iOS \
-DUSE_APPLE_IDN=ON \
${MATRIX_GENERATE} ${options}
else
mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--disable-dependency-tracking \
CFLAGS="-isysroot $(xcrun --sdk iphoneos --show-sdk-path 2>/dev/null)" \
--host=aarch64-apple-darwin \
@@ -469,12 +469,12 @@ jobs:
-DANDROID_ABI=arm64-v8a \
-DANDROID_PLATFORM="android-${MATRIX_PLATFORM}" \
-DCMAKE_TOOLCHAIN_FILE="${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake" -DCMAKE_WARN_DEPRECATED=OFF \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
${MATRIX_OPTIONS}
else
TOOLCHAIN="${ANDROID_NDK_HOME}/toolchains/llvm/prebuilt/linux-x86_64"
mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \
CC="$TOOLCHAIN/bin/aarch64-linux-android${MATRIX_PLATFORM}-clang" \
AR="$TOOLCHAIN/bin/llvm-ar" \
RANLIB="$TOOLCHAIN/bin/llvm-ranlib" \
@@ -569,7 +569,7 @@ jobs:
-DCMAKE_SYSTEM_PROCESSOR=x86 \
-DCMAKE_C_COMPILER_TARGET=i586-pc-msdosdjgpp \
-DCMAKE_C_COMPILER="$HOME/djgpp/bin/i586-pc-msdosdjgpp-gcc" \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DCURL_USE_LIBPSL=OFF \
-DOPENSSL_INCLUDE_DIR="$HOME/djgpp/include" \
@@ -580,7 +580,7 @@ jobs:
-DWATT_ROOT="$HOME/djgpp/net/watt"
else
autoreconf -fi
mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \
CC="$HOME/djgpp/bin/i586-pc-msdosdjgpp-gcc" \
AR="$HOME/djgpp/bin/i586-pc-msdosdjgpp-ar" \
RANLIB="$HOME/djgpp/bin/i586-pc-msdosdjgpp-ranlib" \

View File

@@ -96,11 +96,11 @@ jobs:
if [ "${MATRIX_BUILD}" = 'cmake' ]; then
cmake -B bld -G Ninja -D_CURL_PREFILL=ON ${options} \
-DCMAKE_INSTALL_PREFIX="$HOME"/curl-install \
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30 -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30 \
-DCURL_WERROR=ON \
${MATRIX_CONFIG}
else
mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--prefix="$HOME"/curl-install \
--with-libssh2 \
--disable-dependency-tracking \
@@ -290,7 +290,7 @@ jobs:
-DCMAKE_INSTALL_PREFIX="${HOME}"/curl-install \
-DCMAKE_C_FLAGS="${CFLAGS_CMAKE} ${CPPFLAGS}" \
-DCMAKE_BUILD_TYPE="${MATRIX_TYPE}" \
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30 -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30 \
-DCURL_WERROR=ON \
${MATRIX_CONFIG}
done
@@ -300,7 +300,7 @@ jobs:
fi
else
export CFLAGS CPPFLAGS
mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--prefix="$HOME"/curl-install \
--with-libssh2 \
--disable-dependency-tracking \
@@ -512,7 +512,7 @@ jobs:
cmake -B "bld${_chkprefill}" -G Ninja ${options} \
-DCMAKE_C_COMPILER=gcc \
-DCMAKE_BUILD_TYPE="${MATRIX_TYPE}" \
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30 -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=30 \
-DCURL_WERROR=ON \
-DUSE_LIBIDN2=OFF \
${MATRIX_CONFIG}
@@ -636,13 +636,13 @@ jobs:
cmake -B bld -G Ninja \
-DCMAKE_SYSTEM_NAME=Windows \
-DCMAKE_C_COMPILER_TARGET="${TRIPLET}" \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DCURL_USE_SCHANNEL=ON -DUSE_WIN32_IDN=ON \
-DCURL_USE_LIBPSL=OFF \
${options}
else
mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
mkdir bld && cd bld && ../configure --enable-unity --enable-warnings --enable-werror \
--host="${TRIPLET}" \
--with-schannel --with-winidn \
--without-libpsl \
@@ -741,14 +741,14 @@ jobs:
-DCMAKE_RC_COMPILER=arm-mingw32ce-windres \
-DMINGW32CE_LIBRARY_DIR="$HOME/opt/mingw32ce/arm-mingw32ce/lib" \
-DCMAKE_IGNORE_PREFIX_PATH=/opt/homebrew \
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=50 -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON -DCMAKE_UNITY_BUILD_BATCH_SIZE=50 \
-DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=ON -DBUILD_STATIC_CURL=OFF \
-DCURL_WERROR=ON \
-DCURL_USE_SCHANNEL=ON \
-DCURL_USE_LIBPSL=OFF
else
autoreconf -fi
mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-test-bundles --enable-warnings --enable-werror \
mkdir bld && cd bld && ../configure --disable-dependency-tracking --enable-unity --enable-warnings --enable-werror \
--host=arm-mingw32ce \
--with-schannel \
--without-libpsl \
@@ -936,7 +936,7 @@ jobs:
-DCMAKE_EXE_LINKER_FLAGS="-INCREMENTAL:NO ${ldflags}" \
-DCMAKE_SHARED_LINKER_FLAGS="-INCREMENTAL:NO ${ldflags}" \
-DCMAKE_VS_GLOBALS="TrackFileAccess=false${vsglobals}" \
-DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \
-DCMAKE_UNITY_BUILD=ON \
-DCURL_WERROR=ON \
-DLIBPSL_INCLUDE_DIR="${MINGW_PREFIX}/include" \
-DLIBPSL_LIBRARY="${MINGW_PREFIX}/lib/libpsl.dll.a" \

View File

@@ -287,14 +287,12 @@ if(ENABLE_CURLDEBUG)
list(APPEND CURL_DEBUG_MACROS "CURLDEBUG")
endif()
option(CURL_TEST_BUNDLES "Build tests into single-binary bundles" OFF)
option(CURL_CLANG_TIDY "Run the build through clang-tidy" OFF)
if(CURL_CLANG_TIDY)
# clang-tidy is not looking into #included sources, thus not compatible with
# unity builds and test bundles.
set(CMAKE_UNITY_BUILD OFF)
set(CURL_TEST_BUNDLES OFF)
set(CURL_MK_UNITY_OPTION "--embed")
set(_tidy_checks "")
list(APPEND _tidy_checks "-clang-analyzer-security.insecureAPI.strcpy")
list(APPEND _tidy_checks "-clang-analyzer-optin.performance.Padding")

View File

@@ -68,7 +68,6 @@ if [ "${BUILD_SYSTEM}" = 'CMake' ]; then
fi
# shellcheck disable=SC2086
time cmake -G "${PRJ_GEN}" ${TARGET} \
-DCURL_TEST_BUNDLES=ON \
-DCURL_WERROR=ON \
-DBUILD_SHARED_LIBS="${SHARED}" \
-DCURL_STATIC_CRT=ON \

View File

@@ -651,29 +651,6 @@ AS_HELP_STRING([--disable-unity],[Disable unity (default)]),
AM_CONDITIONAL([USE_UNITY], [test "$want_unity" = 'yes'])
dnl -----------------------
dnl whether to bundle tests
dnl -----------------------
want_test_bundles='no'
AC_MSG_CHECKING([whether to build tests into single-binary bundles])
AC_ARG_ENABLE(test-bundles,
AS_HELP_STRING([--enable-test-bundles],[Enable test bundles])
AS_HELP_STRING([--disable-test-bundles],[Disable test bundles (default)]),
[ case "$enableval" in
yes)
want_test_bundles='yes'
AC_MSG_RESULT([yes])
;;
*)
AC_MSG_RESULT([no])
;;
esac ],
AC_MSG_RESULT([no])
)
AM_CONDITIONAL([USE_TEST_BUNDLES], [test "$want_test_bundles" = 'yes'])
dnl ************************************************************
dnl switch off particular protocols
dnl

View File

@@ -244,7 +244,6 @@ target_link_libraries(my_target PRIVATE CURL::libcurl)
- `CURL_LTO`: Enable compiler Link Time Optimizations. Default: `OFF`
- `CURL_STATIC_CRT`: Build libcurl with static CRT with MSVC (`/MT`) (requires UCRT, static libcurl or no curl executable). Default: `OFF`
- `CURL_TARGET_WINDOWS_VERSION`: Minimum target Windows version as hex string.
- `CURL_TEST_BUNDLES`: Build tests into single-binary bundles. Default: `OFF`
- `CURL_WERROR`: Turn compiler warnings into errors. Default: `OFF`
- `ENABLE_CURLDEBUG`: Enable TrackMemory debug feature. Default: =`ENABLE_DEBUG`
- `ENABLE_CURL_MANUAL`: Build the man page for curl and enable its `-M`/`--manual` option. Default: `ON`

View File

@@ -21,7 +21,7 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Get 'DPAGES' variable
# Get SUPPORT, DPAGES variables
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")

View File

@@ -27,6 +27,7 @@ AUTOMAKE_OPTIONS = foreign no-dependencies
MANPAGE = curl.1
ASCIIPAGE = curl.txt
# Get SUPPORT, DPAGES variables
include Makefile.inc
EXTRA_DIST = $(DPAGES) MANPAGE.md $(SUPPORT) CMakeLists.txt mainpage.idx

View File

@@ -21,7 +21,7 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Shared between Makefile.am and CMakeLists.txt
# Shared between CMakeLists.txt and Makefile.am
SUPPORT = \
_AUTHORS.md \

View File

@@ -24,7 +24,7 @@
add_custom_target(curl-examples)
# Get 'check_PROGRAMS' variable
# Get check_PROGRAMS variable
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
@@ -37,7 +37,6 @@ foreach(_target IN LISTS check_PROGRAMS)
if(LIB_SELECTED STREQUAL LIB_STATIC AND WIN32)
set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_STATICLIB")
endif()
set_target_properties(${_target_name} PROPERTIES
OUTPUT_NAME "${_target}" UNITY_BUILD OFF
PROJECT_LABEL "Example ${_target}")
set_target_properties(${_target_name} PROPERTIES OUTPUT_NAME "${_target}" PROJECT_LABEL "Example ${_target}"
UNITY_BUILD OFF)
endforeach()

View File

@@ -57,7 +57,7 @@ LDADD = $(LIBDIR)/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@
# This might hold -Werror
CFLAGS += @CURL_CFLAG_EXTRAS@
# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
# Get check_PROGRAMS variable
include Makefile.inc
all: $(check_PROGRAMS)

View File

@@ -21,6 +21,7 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Shared between CMakeLists.txt and Makefile.am
# These are all libcurl example programs to be test compiled
check_PROGRAMS = \

View File

@@ -21,7 +21,7 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Get 'man_MANS' variable
# Get man_MANS variable
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")

View File

@@ -27,6 +27,7 @@ AUTOMAKE_OPTIONS = foreign no-dependencies
SUBDIRS = opts
if BUILD_DOCS
# Get man_MANS variable
include Makefile.inc
CURLPAGES = $(man_MANS:.3=.md)

View File

@@ -21,8 +21,7 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Shared between Makefile.am and CMakeLists.txt
# Shared between CMakeLists.txt and Makefile.am
man_MANS = \
curl_easy_cleanup.3 \

View File

@@ -21,7 +21,7 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Get 'man_MANS' variable
# Get man_MANS variable
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")

View File

@@ -25,6 +25,7 @@
AUTOMAKE_OPTIONS = foreign no-dependencies
if BUILD_DOCS
# Get man_MANS variable
include Makefile.inc
CURLPAGES = $(man_MANS:.3=.md)

View File

@@ -21,7 +21,7 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Shared between Makefile.am and CMakeLists.txt
# Shared between CMakeLists.txt and Makefile.am
man_MANS = \
CURLINFO_ACTIVESOCKET.3 \

View File

@@ -312,11 +312,9 @@ SPDX-License-Identifier: curl
### test bundles
The `--enable-test-bundles` (autotools) and `-DCURL_TEST_BUNDLES=ON` (cmake)
build options allow to build tests bundled into single executables, one for
libtests, one for unit tests and one for servers.
The executables' first argument is the name of libtest, unit test or server
respectively.
Individual tests are bundled into single executables, one for libtests, one
for unit tests and one for servers. The executables' first argument is
the name of libtest, unit test or server respectively.
In these executables, the build process automatically renames the entry point
to a unique symbol. `test` becomes `test_<tool>`, e.g. `test_lib1598` or
`test_unit1305`. For servers `main` becomes `main_sws` for the `sws` server,

View File

@@ -29,7 +29,7 @@ set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}
configure_file("curl_config.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/curl_config.h")
# Get 'CSOURCES', 'HHEADERS' variables
# Get CSOURCES, HHEADERS variables
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
@@ -231,7 +231,7 @@ if(BUILD_SHARED_LIBS)
option(CURL_LIBCURL_VERSIONED_SYMBOLS "Enable libcurl versioned symbols" OFF)
if(CURL_LIBCURL_SOVERSION OR CURL_LIBCURL_VERSIONED_SYMBOLS)
# Get 'VERSIONCHANGE', 'VERSIONADD', 'VERSIONDEL', 'VERSIONINFO' variables
# Get VERSIONCHANGE, VERSIONADD, VERSIONDEL, VERSIONINFO variables
curl_transform_makefile_inc("Makefile.soname" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.soname.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.soname.cmake")

View File

@@ -57,8 +57,6 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
# Prevent LIBS from being used for all link targets
LIBS = $(BLANK_AT_MAKETIME)
include Makefile.soname
AM_CPPFLAGS += -DBUILDING_LIBCURL
AM_LDFLAGS =
AM_CFLAGS =
@@ -69,7 +67,7 @@ if CURLDEBUG
AM_CPPFLAGS += -DCURLDEBUG
endif
# Makefile.inc provides the CSOURCES and HHEADERS defines
# Get CSOURCES, HHEADERS variables
include Makefile.inc
if DOING_NATIVE_WINDOWS
@@ -86,7 +84,7 @@ if CURLDEBUG
curl_EXCLUDE += memdebug.c
endif
libcurl_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CSOURCES)
@PERL@ $(top_srcdir)/scripts/mk-unity.pl $(srcdir) $(CSOURCES) --exclude $(curl_EXCLUDE) > libcurl_unity.c
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --srcdir $(srcdir) --include $(CSOURCES) --exclude $(curl_EXCLUDE) > libcurl_unity.c
nodist_libcurl_la_SOURCES = libcurl_unity.c
libcurl_la_SOURCES = $(curl_EXCLUDE)
@@ -103,6 +101,8 @@ libcurl_la_LDFLAGS_EXTRA =
libcurl_la_CFLAGS_EXTRA =
if CURL_LT_SHLIB_USE_VERSION_INFO
# Get VERSIONCHANGE, VERSIONADD, VERSIONDEL, VERSIONINFO variables
include Makefile.soname
libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO)
endif

View File

@@ -21,6 +21,7 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Shared between CMakeLists.txt and Makefile.am
LIB_CURLX_CFILES = \
curlx/base64.c \

View File

@@ -21,6 +21,7 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Shared between CMakeLists.txt and Makefile.am
# Keep in sync with CURL_LIBCURL_VERSIONED_SYMBOLS_SONAME in configure.ac
VERSIONCHANGE=12

View File

@@ -23,48 +23,91 @@
#
###########################################################################
# Helper script for "unity"-like support in autotools, to generate the umbrella
# C source that includes the individual source files. Reads Makefile.inc and
# accepts the variable name containing all the source files to include. Also
# allow a list of exceptions that are to be excluded from the generated file.
# Helper script for "unity"-like support in autotools and to bundle up tests
# for both autotools and cmake. It generates the umbrella C source that
# includes the individual source files and tests.
use strict;
use warnings;
if(!@ARGV) {
die "Usage: $0 [<c-sources>] [--exclude <exclude-c-sources>]\n";
die "Usage: $0 [--test <tests>] [--include <include-c-sources>] [--exclude <exclude-c-sources>] [--srcdir <srcdir>] [--embed]\n";
}
my $srcdir = shift @ARGV;
# Specific sources to exclude or add as an extra source file
my @src;
my %exclude;
my %include;
my $in_exclude = 0;
my $in_include = 0;
my $srcdir = "";
my $in_srcdir = 0;
my $any_test = 0;
my $embed = 0;
foreach my $src (@ARGV) {
if($in_exclude) {
$exclude{$src} = 1;
if($src eq "--test") {
$in_exclude = 0;
$in_include = 0;
}
elsif($src eq "--exclude") {
$in_exclude = 1;
$in_include = 0;
}
elsif($src eq "--include") {
$in_exclude = 0;
$in_include = 1;
}
elsif($src eq "--embed") {
$embed = 1;
}
elsif($src eq "--srcdir") {
$in_srcdir = 1;
}
elsif($in_srcdir) {
$srcdir = $src;
$in_srcdir = 0;
}
elsif($in_exclude) {
$exclude{$src} = 1;
}
elsif($in_include) {
$include{$src} = 1;
push @src, $src;
}
else {
push @src, $src;
$any_test = 1;
}
}
print <<HEADER
/* !checksrc! disable COPYRIGHT all */
HEADER
;
print "/* !checksrc! disable COPYRIGHT all */\n\n";
if($any_test) {
print "#include \"first.h\"\n\n";
}
my $tlist = "";
foreach my $src (@src) {
if($src =~ /\.c$/g && !exists $exclude{$src}) {
if(-e "$srcdir/$src") {
print "#include \"$srcdir/$src\"\n";
if($src =~ /([a-z0-9]+)\.c$/ && !exists $exclude{$src}) {
my $name = $1;
my $fn = $src;
if($srcdir ne "" && (exists $include{$src} || $embed) && -e "$srcdir/$fn") {
$fn = $srcdir . "/" . $fn;
}
if($embed) {
my $content = do { local $/; open my $fh, '<', $fn or die $!; <$fh> };
print $content;
}
else {
print "#include \"$src\"\n";
print "#include \"$fn\"\n";
}
if(not exists $include{$src}) { # register test entry function
$tlist .= " {\"$name\", test_$name},\n";
}
}
}
if($any_test) {
print "\nstatic const struct entry_s s_entries[] = {\n$tlist};\n";
print "\n#include \"first.c\"\n";
}

View File

@@ -68,7 +68,7 @@ if(CURL_CA_EMBED_SET)
endif()
endif()
# Get 'CURL_CFILES', 'CURLX_CFILES', 'CURL_HFILES' variables
# Get CURL_CFILES, CURLX_CFILES, CURL_HFILES variables
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")

View File

@@ -67,6 +67,7 @@ if USE_UNICODE
UNICODEFLAG = -municode
endif
# Get CURL_CFILES, CURLX_CFILES, CURL_HFILES variables
include Makefile.inc
curl_cfiles_gen =
@@ -80,7 +81,7 @@ else
curl_CURLX = $(CURLX_CFILES)
endif
curltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(curl_cfiles_gen) $(curl_CURLX)
@PERL@ $(top_srcdir)/scripts/mk-unity.pl $(srcdir) $(CURL_CFILES) $(curl_cfiles_gen) $(curl_CURLX) > curltool_unity.c
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --srcdir $(srcdir) --include $(CURL_CFILES) $(curl_cfiles_gen) $(curl_CURLX) > curltool_unity.c
nodist_curl_SOURCES = curltool_unity.c
curl_SOURCES =
@@ -112,7 +113,7 @@ libcurltool_la_CFLAGS =
libcurltool_la_LDFLAGS = -static $(LINKFLAGS)
if USE_UNITY
libcurltool_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CURL_CFILES) $(curl_CURLX)
@PERL@ $(top_srcdir)/scripts/mk-unity.pl $(srcdir) $(CURL_CFILES) $(curl_CURLX) > libcurltool_unity.c
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --srcdir $(srcdir) --include $(CURL_CFILES) $(curl_CURLX) > libcurltool_unity.c
nodist_libcurltool_la_SOURCES = libcurltool_unity.c
libcurltool_la_SOURCES =

View File

@@ -21,7 +21,8 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# ./src/Makefile.inc
# Shared between CMakeLists.txt and Makefile.am
# Using the backslash as line continuation character might be problematic with
# some make flavours. If we ever want to change this in a portable manner then
# we should consider this idea :

View File

@@ -24,7 +24,9 @@
*
***************************************************************************/
#ifndef CURL_NO_OLDIES
#define CURL_NO_OLDIES
#endif
/*
* curl_setup.h may define preprocessor macros such as _FILE_OFFSET_BITS and

View File

@@ -43,12 +43,7 @@ static const struct xattr_mapping {
/* returns a new URL that needs to be freed */
/* @unittest: 1621 */
#ifdef UNITTESTS
char *stripcredentials(const char *url);
#else
static
#endif
char *stripcredentials(const char *url)
UNITTEST char *stripcredentials(const char *url)
{
CURLU *u;
CURLUcode uc;

View File

@@ -38,6 +38,10 @@
#ifdef USE_XATTR
int fwrite_xattr(CURL *curl, const char *url, int fd);
#ifdef UNITTESTS
UNITTEST char *stripcredentials(const char *url);
#endif
#else
#define fwrite_xattr(a,b,c) 0
#endif

View File

@@ -62,7 +62,6 @@ EXTRA_DIST = \
http2-server.pl \
http3-server.pl \
memanalyze.pl \
mk-bundle.pl \
negtelnetserver.py \
nghttpx.conf \
pathhelp.pm \

View File

@@ -21,7 +21,7 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Get 'CERTCONFIG_CA', 'CERTCONFIGS', 'GENERATEDCERTS', 'SRPFILES' variables
# Get CERTCONFIG_CA, CERTCONFIGS, GENERATEDCERTS, SRPFILES variables
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")

View File

@@ -23,6 +23,7 @@
###########################################################################
AUTOMAKE_OPTIONS = foreign
# Get CERTCONFIG_CA, CERTCONFIGS, GENERATEDCERTS, SRPFILES variables
include Makefile.inc
EXTRA_DIST = $(CERTCONFIG_CA) $(CERTCONFIGS) $(SRPFILES) CMakeLists.txt \

View File

@@ -21,6 +21,8 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Shared between CMakeLists.txt and Makefile.am
CERTCONFIG_CA = \
test-ca.cnf \
test-ca.prm

View File

@@ -22,9 +22,6 @@ internal hash create/add/destroy testing
<tool>
unit1305
</tool>
<command>
%TESTNUMBER
</command>
</client>
</testcase>

View File

@@ -14,8 +14,6 @@ none
</server>
<features>
unittest
https
pop3s
</features>
<name>
unit tests for stripcredentials from URL

View File

@@ -106,7 +106,7 @@ Finally, this is the real page!
http
</server>
<tool>
libauthretry
lib2023
</tool>
<name>

View File

@@ -120,7 +120,7 @@ http
crypto
</features>
<tool>
libauthretry
lib2023
</tool>
<name>

View File

@@ -203,7 +203,7 @@ SSL
http
</server>
<tool>
libauthretry
lib2023
</tool>
<name>

View File

@@ -156,7 +156,7 @@ http
crypto
</features>
<tool>
libauthretry
lib2023
</tool>
<name>

View File

@@ -179,7 +179,7 @@ http
crypto
</features>
<tool>
libauthretry
lib2023
</tool>
<name>

View File

@@ -239,7 +239,7 @@ SSL
http
</server>
<tool>
libauthretry
lib2023
</tool>
<name>

View File

@@ -176,7 +176,7 @@ SSL
http
</server>
<tool>
libauthretry
lib2023
</tool>
<name>

View File

@@ -228,7 +228,7 @@ SSL
http
</server>
<tool>
libauthretry
lib2023
</tool>
<name>

View File

@@ -242,7 +242,7 @@ SSL
http
</server>
<tool>
libauthretry
lib2023
</tool>
<name>

View File

@@ -75,7 +75,7 @@ SSL
http
</server>
<tool>
libntlmconnect
lib2032
</tool>
<name>

View File

@@ -27,7 +27,7 @@ http
Pre-request callback for HTTP
</name>
<tool>
libprereq
lib2082
</tool>
<command>

View File

@@ -21,7 +21,7 @@ ftp
Pre-request callback for FTP
</name>
<tool>
libprereq
lib2082
</tool>
<command>

View File

@@ -27,7 +27,7 @@ http
Pre-request callback for HTTP with callback terminating transfer
</name>
<tool>
libprereq
lib2082
</tool>
<command>

View File

@@ -35,7 +35,7 @@ http
Pre-request callback for HTTP with location following
</name>
<tool>
libprereq
lib2082
</tool>
<command>

View File

@@ -32,7 +32,7 @@ http-ipv6
Pre-request callback for HTTP IPv6
</name>
<tool>
libprereq
lib2082
</tool>
<command>

View File

@@ -71,7 +71,6 @@ BEGIN {
%feature
%keywords
@protocols
$bundle
$dev_null
);
}
@@ -141,6 +140,5 @@ our @protocols; # array of lowercase supported protocol servers
our %feature; # hash of enabled features
our %keywords; # hash of keywords from the test spec
our $has_shared; # built as a shared library
our $bundle = 0; # use bundled server, libtest, unit binaries
1;

View File

@@ -24,7 +24,7 @@
add_custom_target(test-http-clients)
# Get 'check_PROGRAMS' variable
# Get check_PROGRAMS variable
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
@@ -42,7 +42,6 @@ foreach(_target IN LISTS check_PROGRAMS)
if(LIB_SELECTED STREQUAL LIB_STATIC AND WIN32)
set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "CURL_STATICLIB")
endif()
set_target_properties(${_target_name} PROPERTIES
OUTPUT_NAME "${_target}" UNITY_BUILD OFF
PROJECT_LABEL "Test client ${_target}")
set_target_properties(${_target_name} PROPERTIES OUTPUT_NAME "${_target}" ROJECT_LABEL "Test client ${_target}"
UNITY_BUILD OFFP)
endforeach()

View File

@@ -58,7 +58,7 @@ LDADD = $(LIBDIR)/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@
# This might hold -Werror
CFLAGS += @CURL_CFLAG_EXTRAS@
# Makefile.inc provides the check_PROGRAMS define
# Get check_PROGRAMS variable
include Makefile.inc
all: $(check_PROGRAMS)

View File

@@ -21,8 +21,8 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# Shared between CMakeLists.txt and Makefile.am
# These are all libcurl example programs to be test compiled
check_PROGRAMS = \
h2-pausing \
h2-serverpush \

View File

@@ -2,11 +2,6 @@
#
# SPDX-License-Identifier: curl
lib[1-4][0-9][0-9][0-9]
lib[5-9][0-9][0-9]
lib1521.c
libtest_bundle.c
libtests
libauthretry
libntlmconnect
libprereq
libtests.c
lib1521.c

View File

@@ -22,8 +22,7 @@
#
###########################################################################
# Get 'LIBTESTPROGS', '*_SOURCES', 'TESTUTIL', 'TSTTRACE', 'WARNLESS', 'MULTIBYTE', 'INET_PTON', 'TIMEDIFF', 'THREADS', 'MEMPTR'
# 'FIRSTFILES' variables
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, MEMPTR, CURLX_SRCS, TESTFILES variables
curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
@@ -35,54 +34,29 @@ add_custom_command(
"${PROJECT_SOURCE_DIR}/include/curl/curl.h"
VERBATIM)
if(CURL_TEST_BUNDLES)
add_custom_command(
OUTPUT "libtest_bundle.c"
COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" "${CMAKE_CURRENT_SOURCE_DIR}" > "libtest_bundle.c"
DEPENDS
"${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" ${FIRSTFILES} "lib1521.c"
"${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc"
VERBATIM)
add_custom_command(
OUTPUT "${BUNDLE_SRC}"
COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" --test ${TESTFILES} "lib1521.c"
${CURL_MK_UNITY_OPTION} --srcdir "${CMAKE_CURRENT_SOURCE_DIR}" > "${BUNDLE_SRC}"
DEPENDS
"${PROJECT_SOURCE_DIR}/scripts/mk-unity.pl" "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc" ${FIRSTFILES} ${TESTFILES} "lib1521.c"
VERBATIM)
set(LIBTESTPROGS "libtests")
set(libtests_SOURCES "libtest_bundle.c")
list(APPEND libtests_SOURCES ${TESTUTIL} ${TSTTRACE})
if(LIB_SELECTED STREQUAL LIB_SHARED)
# These are part of the libcurl static lib. Add them here when linking shared.
list(APPEND libtests_SOURCES ${WARNLESS} ${MULTIBYTE} ${INET_PTON} ${TIMEDIFF} ${THREADS} ${MEMPTR})
endif()
set(_sources "")
if(LIB_SELECTED STREQUAL LIB_SHARED)
list(APPEND _sources ${MEMPTR} ${CURLX_SRCS}) # These are part of the libcurl static lib. Add them here when linking shared.
endif()
foreach(_target IN LISTS LIBTESTPROGS)
if(DEFINED ${_target}_SOURCES)
set(_sources ${${_target}_SOURCES})
else()
set(_sources ${nodist_${_target}_SOURCES})
endif()
if(LIB_SELECTED STREQUAL LIB_STATIC)
# These are part of the libcurl static lib. Do not compile/link them again.
list(REMOVE_ITEM _sources ${WARNLESS} ${MULTIBYTE} ${INET_PTON} ${TIMEDIFF} ${THREADS})
endif()
string(TOUPPER ${_target} _upper_target)
set(_target_name "${_target}")
add_executable(${_target_name} EXCLUDE_FROM_ALL ${_sources})
add_dependencies(testdeps ${_target_name})
target_link_libraries(${_target_name} ${LIB_SELECTED} ${CURL_LIBS})
target_include_directories(${_target_name} 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" # to be able to build generated tests
"${PROJECT_SOURCE_DIR}/tests/unit" # for curlcheck.h
)
set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
if(NOT CURL_TEST_BUNDLES)
set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS ${_upper_target})
endif()
set_target_properties(${_target_name} PROPERTIES
OUTPUT_NAME "${_target}"
PROJECT_LABEL "Test libtest ${_target}")
endforeach()
add_executable(libtests EXCLUDE_FROM_ALL ${_sources} ${UTILS} "${BUNDLE_SRC}")
add_dependencies(testdeps libtests)
target_link_libraries(libtests ${LIB_SELECTED} ${CURL_LIBS})
target_include_directories(libtests 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" # to be able to build generated tests
"${PROJECT_SOURCE_DIR}/tests/unit" # for curlcheck.h
)
set_property(TARGET libtests APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}" "CURL_NO_OLDIES" "CURL_DISABLE_DEPRECATION")
set_target_properties(libtests PROPERTIES OUTPUT_NAME "${BUNDLE}" PROJECT_LABEL "Test ${BUNDLE}")

View File

@@ -40,27 +40,21 @@ AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_srcdir)/tests/libtest \
-I$(top_srcdir)/tests/unit
EXTRA_DIST = test307.pl test610.pl test613.pl test1013.pl test1022.pl \
CMakeLists.txt mk-lib1521.pl .checksrc
# Get BUNDLE, BUNDLE_SRC, FIRSTFILES, UTILS, MEMPTR, CURLX_SRCS, TESTFILES variables
include Makefile.inc
EXTRA_DIST = CMakeLists.txt .checksrc $(FIRSTFILES) $(UTILS) $(MEMPTR) $(TESTFILES) \
test307.pl test610.pl test613.pl test1013.pl test1022.pl mk-lib1521.pl
CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@
CFLAGS += @CURL_CFLAG_EXTRAS@
CLEANFILES = lib1521.c
# Prevent LIBS from being used for all link targets
LIBS = $(BLANK_AT_MAKETIME)
SUPPORTFILES_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@
TESTUTIL_LIBS = $(top_builddir)/lib/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@
# Dependencies (may need to be overridden)
LDADD = $(SUPPORTFILES_LIBS)
# Makefile.inc provides the source defines (TESTUTIL, SUPPORTFILES,
# LIBTESTPROGS, lib*_SOURCES, and lib*_CFLAGS)
include Makefile.inc
LDADD = $(top_builddir)/lib/libcurl.la @LIBCURL_PC_LIBS_PRIVATE@
noinst_LTLIBRARIES =
@@ -74,49 +68,38 @@ if CURLDEBUG
AM_CPPFLAGS += -DCURLDEBUG
endif
AM_CPPFLAGS += -DCURL_NO_OLDIES -DCURL_DISABLE_DEPRECATION
AM_LDFLAGS =
AM_CFLAGS =
libstubgss_la_LDFLAGS_EXTRA =
if CURL_LT_SHLIB_USE_NO_UNDEFINED
libstubgss_la_LDFLAGS_EXTRA += -no-undefined
endif
# Build a stub gssapi implementation for testing
if BUILD_STUB_GSS
noinst_LTLIBRARIES += libstubgss.la
libstubgss_la_CPPFLAGS = $(AM_CPPFLAGS)
libstubgss_la_LDFLAGS = $(AM_LDFLAGS) $(libstubgss_la_LDFLAGS_EXTRA) -avoid-version -rpath /nowhere
libstubgss_la_LDFLAGS = $(AM_LDFLAGS) -avoid-version -rpath /nowhere
if CURL_LT_SHLIB_USE_NO_UNDEFINED
libstubgss_la_LDFLAGS += -no-undefined
endif
libstubgss_la_CFLAGS = $(AM_CFLAGS) -g
libstubgss_la_SOURCES = stub_gssapi.c stub_gssapi.h
libstubgss_la_LIBADD =
libstubgss_la_DEPENDENCIES =
endif
BUNDLE=libtests
if USE_TEST_BUNDLES
libtest_bundle.c: $(top_srcdir)/tests/mk-bundle.pl Makefile.inc $(FIRSTFILES) lib1521.c
@PERL@ $(top_srcdir)/tests/mk-bundle.pl $(srcdir) > libtest_bundle.c
bundle_EXCLUDE =
if USE_CPPFLAG_CURL_STATICLIB
# These are part of the libcurl static lib. Add them here when linking shared.
bundle_EXCLUDE += $(MEMPTR) $(CURLX_SRCS)
endif
$(BUNDLE_SRC): $(top_srcdir)/scripts/mk-unity.pl Makefile.inc $(FIRSTFILES) $(UTILS) $(MEMPTR) $(CURLX_SRCS) $(TESTFILES) lib1521.c
@PERL@ $(top_srcdir)/scripts/mk-unity.pl --include $(UTILS) $(MEMPTR) $(CURLX_SRCS) --test $(TESTFILES) lib1521.c --exclude $(bundle_EXCLUDE) > $(BUNDLE_SRC)
noinst_PROGRAMS = $(BUNDLE)
nodist_libtests_SOURCES = libtest_bundle.c
libtests_SOURCES = $(TESTUTIL) $(TSTTRACE)
libtests_LDADD = $(TESTUTIL_LIBS)
CLEANFILES += libtest_bundle.c
if USE_CPPFLAG_CURL_STATICLIB
else
# These are part of the libcurl static lib. Add them here when linking shared.
libtests_SOURCES += $(WARNLESS) $(MULTIBYTE) $(INET_PTON) $(TIMEDIFF) $(THREADS) $(MEMPTR)
endif
else
noinst_PROGRAMS = $(LIBTESTPROGS)
endif
nodist_libtests_SOURCES = $(BUNDLE_SRC)
libtests_SOURCES = $(bundle_EXCLUDE)
CLEANFILES = $(BUNDLE_SRC) lib1521.c
lib1521.c: $(top_srcdir)/tests/libtest/mk-lib1521.pl $(top_srcdir)/include/curl/curl.h
@PERL@ $(top_srcdir)/tests/libtest/mk-lib1521.pl < $(top_srcdir)/include/curl/curl.h lib1521.c
@@ -129,7 +112,7 @@ CS_ = $(CS_0)
# ignore generated C files since they play by slightly different rules!
checksrc: lib1521.c
$(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
-W$(srcdir)/libtest_bundle.c \
-W$(srcdir)/$(BUNDLE_SRC) \
$(srcdir)/*.[ch])
if NOT_CURL_CI

View File

@@ -21,292 +21,73 @@
# SPDX-License-Identifier: curl
#
###########################################################################
# files used only in some libcurl test programs
TESTUTIL = testutil.c testutil.h
TSTTRACE = testtrace.c testtrace.h
WARNLESS = ../../lib/curlx/warnless.c ../../lib/curlx/warnless.h
MULTIBYTE = ../../lib/curlx/multibyte.c ../../lib/curlx/multibyte.h
THREADS = ../../lib/curl_threads.c ../../lib/curl_threads.h
# Shared between CMakeLists.txt and Makefile.am
BUNDLE = libtests
BUNDLE_SRC = libtests.c
# Files referenced from the bundle source
FIRSTFILES = first.c first.h
# Common files used by test programs
UTILS = testutil.c testutil.h testtrace.c testtrace.h test.h ../unit/curlcheck.h
MEMPTR = memptr.c
# these files are used in every single test program below
TIMEDIFF = ../../lib/curlx/timediff.c ../../lib/curlx/timediff.h
FIRSTFILES = first.c first.h
SUPPORTFILES = $(TIMEDIFF) $(FIRSTFILES) test.h
CURLX_SRCS = \
../../lib/curlx/warnless.c \
../../lib/curlx/warnless.h \
../../lib/curlx/multibyte.c \
../../lib/curlx/multibyte.h \
../../lib/curlx/timediff.c \
../../lib/curlx/timediff.h \
../../lib/curl_threads.c \
../../lib/curl_threads.h
# These are all libcurl test programs
LIBTESTPROGS = libauthretry libntlmconnect libprereq \
lib500 lib501 lib502 lib503 lib504 lib505 lib506 lib507 lib508 lib509 \
lib510 lib511 lib512 lib513 lib514 lib515 lib516 lib517 lib518 lib519 \
lib520 lib521 lib523 lib524 lib525 lib526 lib530 \
lib533 lib536 lib537 lib539 lib540 lib541 lib542 lib543 \
lib544 \
lib547 lib549 lib552 lib553 lib554 lib555 lib556 lib557 lib558 \
lib559 lib560 lib562 lib564 lib566 lib567 lib568 lib569 lib570 \
lib571 lib572 lib573 lib574 lib575 lib576 lib578 lib579 lib582 \
lib583 lib586 lib589 lib590 lib591 lib597 lib598 \
lib599 \
lib643 lib650 lib651 lib652 lib653 lib654 lib655 lib658 \
lib659 lib661 lib666 lib667 lib668 \
lib670 lib674 lib676 lib677 lib678 lib694 lib695 \
lib751 \
lib1156 \
lib1301 \
lib1308 \
lib1485 \
lib1500 lib1501 lib1502 lib1506 lib1507 lib1508 \
lib1509 lib1510 lib1511 lib1512 lib1513 lib1514 lib1515 lib1517 \
lib1518 lib1520 lib1521 lib1522 lib1523 \
lib1525 lib1526 lib1527 lib1528 lib1529 lib1530 lib1531 lib1532 lib1533 \
lib1534 lib1535 lib1536 lib1537 lib1538 \
lib1540 lib1541 lib1542 lib1545 \
lib1550 lib1551 lib1552 lib1553 lib1554 lib1555 lib1556 lib1557 \
lib1558 lib1559 lib1560 lib1564 lib1565 lib1567 lib1568 lib1569 lib1571 \
lib1576 \
lib1591 lib1592 lib1593 lib1594 lib1597 lib1598 \
\
lib1662 \
\
lib1900 lib1901 \
lib1903 lib1905 lib1906 lib1907 lib1908 lib1910 lib1911 lib1912 lib1913 \
lib1915 lib1916 lib1918 lib1919 \
lib1933 lib1934 lib1935 lib1936 lib1937 lib1938 lib1939 lib1940 \
lib1945 lib1947 lib1948 lib1955 lib1956 lib1957 lib1958 lib1959 \
lib1960 lib1964 \
lib1970 lib1971 lib1972 lib1973 lib1974 lib1975 lib1977 lib1978 \
lib2301 lib2302 lib2304 lib2306 lib2308 lib2309 \
lib2402 lib2404 lib2405 \
lib2502 \
lib2700 \
lib3010 lib3025 lib3026 lib3027 \
lib3100 lib3101 lib3102 lib3103 lib3104 lib3105 lib3207 lib3208
libntlmconnect_SOURCES = libntlmconnect.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
libauthretry_SOURCES = libauthretry.c $(SUPPORTFILES)
libprereq_SOURCES = libprereq.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib500_SOURCES = lib500.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(MULTIBYTE)
lib501_SOURCES = lib501.c $(SUPPORTFILES)
lib502_SOURCES = lib502.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib503_SOURCES = lib503.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib504_SOURCES = lib504.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib505_SOURCES = lib505.c $(SUPPORTFILES) $(MULTIBYTE)
lib506_SOURCES = lib506.c $(SUPPORTFILES) $(TESTUTIL)
lib507_SOURCES = lib507.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib508_SOURCES = lib508.c $(SUPPORTFILES)
lib509_SOURCES = lib509.c $(SUPPORTFILES)
lib510_SOURCES = lib510.c $(SUPPORTFILES)
lib511_SOURCES = lib511.c $(SUPPORTFILES)
lib512_SOURCES = lib512.c $(SUPPORTFILES)
lib513_SOURCES = lib513.c $(SUPPORTFILES)
lib514_SOURCES = lib514.c $(SUPPORTFILES)
lib515_SOURCES = lib515.c $(SUPPORTFILES)
lib516_SOURCES = lib516.c $(SUPPORTFILES)
lib517_SOURCES = lib517.c $(SUPPORTFILES)
lib518_SOURCES = lib518.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) $(MULTIBYTE)
lib519_SOURCES = lib519.c $(SUPPORTFILES)
lib520_SOURCES = lib520.c $(SUPPORTFILES)
lib521_SOURCES = lib521.c $(SUPPORTFILES)
lib523_SOURCES = lib523.c $(SUPPORTFILES)
lib524_SOURCES = lib524.c $(SUPPORTFILES)
lib525_SOURCES = lib525.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) $(MULTIBYTE)
lib526_SOURCES = lib526.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib530_SOURCES = lib530.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib533_SOURCES = lib533.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib536_SOURCES = lib536.c $(SUPPORTFILES)
lib537_SOURCES = lib537.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) $(MULTIBYTE)
lib539_SOURCES = lib539.c $(SUPPORTFILES)
lib540_SOURCES = lib540.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib541_SOURCES = lib541.c $(SUPPORTFILES) $(MULTIBYTE)
lib542_SOURCES = lib542.c $(SUPPORTFILES)
lib543_SOURCES = lib543.c $(SUPPORTFILES)
lib544_SOURCES = lib544.c $(SUPPORTFILES)
lib547_SOURCES = lib547.c $(SUPPORTFILES)
lib549_SOURCES = lib549.c $(SUPPORTFILES)
lib552_SOURCES = lib552.c $(SUPPORTFILES) $(WARNLESS)
lib553_SOURCES = lib553.c $(SUPPORTFILES)
lib554_SOURCES = lib554.c $(SUPPORTFILES)
lib555_SOURCES = lib555.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib556_SOURCES = lib556.c $(SUPPORTFILES) $(WARNLESS)
lib557_SOURCES = lib557.c $(SUPPORTFILES)
lib558_SOURCES = lib558.c $(SUPPORTFILES)
lib559_SOURCES = lib559.c $(SUPPORTFILES)
lib560_SOURCES = lib560.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib562_SOURCES = lib562.c $(SUPPORTFILES)
lib564_SOURCES = lib564.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib566_SOURCES = lib566.c $(SUPPORTFILES) $(MULTIBYTE)
lib567_SOURCES = lib567.c $(SUPPORTFILES)
lib568_SOURCES = lib568.c $(SUPPORTFILES) $(TESTUTIL) $(MULTIBYTE)
lib569_SOURCES = lib569.c $(SUPPORTFILES) $(TESTUTIL) $(MULTIBYTE)
lib570_SOURCES = lib570.c $(SUPPORTFILES) $(TESTUTIL)
lib571_SOURCES = lib571.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) $(MULTIBYTE)
lib572_SOURCES = lib572.c $(SUPPORTFILES) $(TESTUTIL) $(MULTIBYTE)
lib573_SOURCES = lib573.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) $(TSTTRACE)
lib574_SOURCES = lib574.c $(SUPPORTFILES)
lib575_SOURCES = lib575.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib576_SOURCES = lib576.c $(SUPPORTFILES)
lib578_SOURCES = lib578.c $(SUPPORTFILES) $(MULTIBYTE)
lib579_SOURCES = lib579.c $(SUPPORTFILES) $(MULTIBYTE)
lib582_SOURCES = lib582.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) $(MULTIBYTE)
lib583_SOURCES = lib583.c $(SUPPORTFILES)
lib586_SOURCES = lib586.c $(SUPPORTFILES)
lib589_SOURCES = lib589.c $(SUPPORTFILES)
lib590_SOURCES = lib590.c $(SUPPORTFILES)
lib591_SOURCES = lib591.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) $(MULTIBYTE)
lib597_SOURCES = lib597.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib598_SOURCES = lib598.c $(SUPPORTFILES)
lib599_SOURCES = lib599.c $(SUPPORTFILES) $(MULTIBYTE)
lib643_SOURCES = lib643.c $(SUPPORTFILES)
lib650_SOURCES = lib650.c $(SUPPORTFILES)
lib651_SOURCES = lib651.c $(SUPPORTFILES)
lib652_SOURCES = lib652.c $(SUPPORTFILES)
lib653_SOURCES = lib653.c $(SUPPORTFILES)
lib654_SOURCES = lib654.c $(SUPPORTFILES)
lib655_SOURCES = lib655.c $(SUPPORTFILES)
lib658_SOURCES = lib658.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib659_SOURCES = lib659.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib661_SOURCES = lib661.c $(SUPPORTFILES)
lib666_SOURCES = lib666.c $(SUPPORTFILES)
lib667_SOURCES = lib667.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib668_SOURCES = lib668.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib670_SOURCES = lib670.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib674_SOURCES = lib674.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib676_SOURCES = lib676.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib677_SOURCES = lib677.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) $(MULTIBYTE)
lib678_SOURCES = lib678.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS) $(MULTIBYTE)
lib694_SOURCES = lib694.c $(SUPPORTFILES)
lib695_SOURCES = lib695.c $(SUPPORTFILES)
lib751_SOURCES = lib751.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1301_SOURCES = lib1301.c $(SUPPORTFILES) $(TESTUTIL)
lib1308_SOURCES = lib1308.c $(SUPPORTFILES)
lib1485_SOURCES = lib1485.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1500_SOURCES = lib1500.c $(SUPPORTFILES) $(TESTUTIL)
lib1501_SOURCES = lib1501.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1502_SOURCES = lib1502.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1506_SOURCES = lib1506.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1156_SOURCES = lib1156.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1507_SOURCES = lib1507.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1508_SOURCES = lib1508.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1509_SOURCES = lib1509.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1510_SOURCES = lib1510.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1511_SOURCES = lib1511.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1512_SOURCES = lib1512.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1513_SOURCES = lib1513.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1514_SOURCES = lib1514.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1515_SOURCES = lib1515.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS)
lib1517_SOURCES = lib1517.c $(SUPPORTFILES)
lib1518_SOURCES = lib1518.c $(SUPPORTFILES)
lib1520_SOURCES = lib1520.c $(SUPPORTFILES)
nodist_lib1521_SOURCES = lib1521.c $(SUPPORTFILES)
lib1521_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)
lib1522_SOURCES = lib1522.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE)
lib1523_SOURCES = lib1523.c $(SUPPORTFILES)
lib1525_SOURCES = lib1525.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1526_SOURCES = lib1526.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1527_SOURCES = lib1527.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1528_SOURCES = lib1528.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1529_SOURCES = lib1529.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1530_SOURCES = lib1530.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1531_SOURCES = lib1531.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1532_SOURCES = lib1532.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1533_SOURCES = lib1533.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1534_SOURCES = lib1534.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1535_SOURCES = lib1535.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1536_SOURCES = lib1536.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1537_SOURCES = lib1537.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1538_SOURCES = lib1538.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1540_SOURCES = lib1540.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS)
lib1541_SOURCES = lib1541.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1542_SOURCES = lib1542.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS)
lib1545_SOURCES = lib1545.c $(SUPPORTFILES)
lib1550_SOURCES = lib1550.c $(SUPPORTFILES)
lib1551_SOURCES = lib1551.c $(SUPPORTFILES)
lib1552_SOURCES = lib1552.c $(SUPPORTFILES) $(TESTUTIL)
lib1553_SOURCES = lib1553.c $(SUPPORTFILES) $(TSTTRACE) $(TESTUTIL)
lib1554_SOURCES = lib1554.c $(SUPPORTFILES)
lib1555_SOURCES = lib1555.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1556_SOURCES = lib1556.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1557_SOURCES = lib1557.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1558_SOURCES = lib1558.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1559_SOURCES = lib1559.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1560_SOURCES = lib1560.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1564_SOURCES = lib1564.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1565_SOURCES = lib1565.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1567_SOURCES = lib1567.c $(SUPPORTFILES)
lib1568_SOURCES = lib1568.c $(SUPPORTFILES)
lib1569_SOURCES = lib1569.c $(SUPPORTFILES)
lib1571_SOURCES = lib1571.c $(SUPPORTFILES)
lib1576_SOURCES = lib1576.c $(SUPPORTFILES)
lib1591_SOURCES = lib1591.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1592_SOURCES = lib1592.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1593_SOURCES = lib1593.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1594_SOURCES = lib1594.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1597_SOURCES = lib1597.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1598_SOURCES = lib1598.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1662_SOURCES = lib1662.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1900_SOURCES = lib1900.c $(SUPPORTFILES)
lib1901_SOURCES = lib1901.c $(SUPPORTFILES)
lib1903_SOURCES = lib1903.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1905_SOURCES = lib1905.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1906_SOURCES = lib1906.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1907_SOURCES = lib1907.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1908_SOURCES = lib1908.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1910_SOURCES = lib1910.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1911_SOURCES = lib1911.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1912_SOURCES = lib1912.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1913_SOURCES = lib1913.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1915_SOURCES = lib1915.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS)
lib1916_SOURCES = lib1916.c $(SUPPORTFILES) $(WARNLESS)
lib1918_SOURCES = lib1918.c $(SUPPORTFILES) $(WARNLESS)
lib1919_SOURCES = lib1919.c $(SUPPORTFILES) $(WARNLESS)
lib1933_SOURCES = lib1933.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1934_SOURCES = lib1934.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1935_SOURCES = lib1935.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1936_SOURCES = lib1936.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1937_SOURCES = lib1937.c $(SUPPORTFILES)
lib1938_SOURCES = lib1938.c $(SUPPORTFILES)
lib1939_SOURCES = lib1939.c $(SUPPORTFILES)
lib1940_SOURCES = lib1940.c $(SUPPORTFILES)
lib1945_SOURCES = lib1945.c $(SUPPORTFILES)
lib1947_SOURCES = lib1947.c $(SUPPORTFILES)
lib1948_SOURCES = lib1948.c $(SUPPORTFILES)
lib1955_SOURCES = lib1955.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1956_SOURCES = lib1956.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1957_SOURCES = lib1957.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1958_SOURCES = lib1958.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1959_SOURCES = lib1959.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1960_SOURCES = lib1960.c $(SUPPORTFILES)
lib1964_SOURCES = lib1964.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1970_SOURCES = lib1970.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1971_SOURCES = lib1971.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1972_SOURCES = lib1972.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1973_SOURCES = lib1973.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1974_SOURCES = lib1974.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1975_SOURCES = lib1975.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1977_SOURCES = lib1977.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib1978_SOURCES = lib1978.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib2301_SOURCES = lib2301.c $(SUPPORTFILES)
lib2302_SOURCES = lib2302.c $(SUPPORTFILES)
lib2304_SOURCES = lib2304.c $(SUPPORTFILES)
lib2306_SOURCES = lib2306.c $(SUPPORTFILES)
lib2308_SOURCES = lib2308.c $(SUPPORTFILES)
lib2309_SOURCES = lib2309.c $(SUPPORTFILES)
lib2402_SOURCES = lib2402.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib2404_SOURCES = lib2404.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib2405_SOURCES = lib2405.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib2502_SOURCES = lib2502.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(WARNLESS)
lib2700_SOURCES = lib2700.c $(SUPPORTFILES) $(TESTUTIL) $(TSTTRACE) $(MULTIBYTE)
lib3010_SOURCES = lib3010.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib3025_SOURCES = lib3025.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib3026_SOURCES = lib3026.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib3027_SOURCES = lib3027.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib3100_SOURCES = lib3100.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib3101_SOURCES = lib3101.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib3102_SOURCES = lib3102.c $(SUPPORTFILES) $(TESTUTIL) $(WARNLESS)
lib3103_SOURCES = lib3103.c $(SUPPORTFILES)
lib3104_SOURCES = lib3104.c $(SUPPORTFILES)
lib3105_SOURCES = lib3105.c $(SUPPORTFILES)
lib3207_SOURCES = lib3207.c $(SUPPORTFILES) $(TESTUTIL) $(THREADS) $(WARNLESS) $(MULTIBYTE) $(MEMPTR)
lib3208_SOURCES = lib3208.c $(SUPPORTFILES) $(TESTUTIL)
# All libtest programs
TESTFILES = \
lib500.c lib501.c lib502.c lib503.c lib504.c lib505.c lib506.c lib507.c lib508.c lib509.c \
lib510.c lib511.c lib512.c lib513.c lib514.c lib515.c lib516.c lib517.c lib518.c lib519.c \
lib520.c lib521.c lib523.c lib524.c lib525.c lib526.c lib530.c \
lib533.c lib536.c lib537.c lib539.c lib540.c lib541.c lib542.c lib543.c \
lib544.c \
lib547.c lib549.c lib552.c lib553.c lib554.c lib555.c lib556.c lib557.c lib558.c \
lib559.c lib560.c lib562.c lib564.c lib566.c lib567.c lib568.c lib569.c lib570.c \
lib571.c lib572.c lib573.c lib574.c lib575.c lib576.c lib578.c lib579.c lib582.c \
lib583.c lib586.c lib589.c lib590.c lib591.c lib597.c lib598.c \
lib599.c \
lib643.c lib650.c lib651.c lib652.c lib653.c lib654.c lib655.c lib658.c \
lib659.c lib661.c lib666.c lib667.c lib668.c \
lib670.c lib674.c lib676.c lib677.c lib678.c lib694.c lib695.c \
lib751.c \
lib1156.c \
lib1301.c \
lib1308.c \
lib1485.c \
lib1500.c lib1501.c lib1502.c lib1506.c lib1507.c lib1508.c \
lib1509.c lib1510.c lib1511.c lib1512.c lib1513.c lib1514.c lib1515.c lib1517.c \
lib1518.c lib1520.c lib1522.c lib1523.c \
lib1525.c lib1526.c lib1527.c lib1528.c lib1529.c lib1530.c lib1531.c lib1532.c lib1533.c \
lib1534.c lib1535.c lib1536.c lib1537.c lib1538.c \
lib1540.c lib1541.c lib1542.c lib1545.c \
lib1550.c lib1551.c lib1552.c lib1553.c lib1554.c lib1555.c lib1556.c lib1557.c \
lib1558.c lib1559.c lib1560.c lib1564.c lib1565.c lib1567.c lib1568.c lib1569.c lib1571.c \
lib1576.c \
lib1591.c lib1592.c lib1593.c lib1594.c lib1597.c lib1598.c \
\
lib1662.c \
\
lib1900.c lib1901.c \
lib1903.c lib1905.c lib1906.c lib1907.c lib1908.c lib1910.c lib1911.c lib1912.c lib1913.c \
lib1915.c lib1916.c lib1918.c lib1919.c \
lib1933.c lib1934.c lib1935.c lib1936.c lib1937.c lib1938.c lib1939.c lib1940.c \
lib1945.c lib1947.c lib1948.c lib1955.c lib1956.c lib1957.c lib1958.c lib1959.c \
lib1960.c lib1964.c \
lib1970.c lib1971.c lib1972.c lib1973.c lib1974.c lib1975.c lib1977.c lib1978.c \
lib2023.c lib2032.c lib2082.c \
lib2301.c lib2302.c lib2304.c lib2306.c lib2308.c lib2309.c \
lib2402.c lib2404.c lib2405.c \
lib2502.c \
lib2700.c \
lib3010.c lib3025.c lib3026.c lib3027.c \
lib3100.c lib3101.c lib3102.c lib3103.c lib3104.c lib3105.c lib3207.c lib3208.c

View File

@@ -21,9 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "test.h"
#include "first.h"
#ifdef HAVE_LOCALE_H
# include <locale.h> /* for setlocale() */
#endif
@@ -120,9 +117,10 @@ int main(int argc, char **argv)
{
char *URL;
CURLcode result;
int basearg;
test_func_t test_func;
entry_func_t entry_func;
char *entry_name;
char *env;
size_t tmp;
CURL_SET_BINMODE(stdout);
@@ -137,61 +135,38 @@ int main(int argc, char **argv)
setlocale(LC_ALL, "");
#endif
test_argc = argc;
test_argv = argv;
test_argc = argc - 1;
test_argv = argv + 1;
#ifdef CURLTESTS_BUNDLED
{
char *test_name;
--test_argc;
++test_argv;
basearg = 2;
if(argc < (basearg + 1)) {
curl_mfprintf(stderr, "Pass testname and URL as arguments please\n");
return 1;
}
test_name = argv[basearg - 1];
test_func = NULL;
{
size_t tmp;
for(tmp = 0; tmp < CURL_ARRAYSIZE(s_tests); ++tmp) {
if(strcmp(test_name, s_tests[tmp].name) == 0) {
test_func = s_tests[tmp].ptr;
break;
}
}
}
if(!test_func) {
curl_mfprintf(stderr, "Test '%s' not found.\n", test_name);
return 1;
}
}
#else
basearg = 1;
if(argc < (basearg + 1)) {
curl_mfprintf(stderr, "Pass URL as argument please\n");
if(argc < 3) {
curl_mfprintf(stderr, "Pass testname and URL as arguments please\n");
return 1;
}
test_func = test;
#endif
entry_name = argv[1];
entry_func = NULL;
for(tmp = 0; tmp < CURL_ARRAYSIZE(s_entries); ++tmp) {
if(strcmp(entry_name, s_entries[tmp].name) == 0) {
entry_func = s_entries[tmp].ptr;
break;
}
}
if(argc > (basearg + 1))
libtest_arg2 = argv[basearg + 1];
if(!entry_func) {
curl_mfprintf(stderr, "Test '%s' not found.\n", entry_name);
return 1;
}
if(argc > (basearg + 2))
libtest_arg3 = argv[basearg + 2];
if(argc > 3)
libtest_arg2 = argv[3];
if(argc > (basearg + 2))
libtest_arg4 = argv[basearg + 3];
if(argc > 4)
libtest_arg3 = argv[4];
URL = argv[basearg]; /* provide this to the rest */
if(argc > 5)
libtest_arg4 = argv[5];
URL = argv[2]; /* provide this to the rest */
env = getenv("CURL_TESTNUM");
if(env)
@@ -201,7 +176,7 @@ int main(int argc, char **argv)
curl_mfprintf(stderr, "URL: %s\n", URL);
result = test_func(URL);
result = entry_func(URL);
curl_mfprintf(stderr, "Test ended with result %d\n", result);
#ifdef _WIN32

View File

@@ -23,17 +23,13 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#define CURL_DISABLE_DEPRECATION 1
#include "curl_setup.h"
#include <curl/curl.h>
#include "test.h"
typedef CURLcode (*test_func_t)(char *);
typedef CURLcode (*entry_func_t)(char *);
#ifdef CURLTESTS_BUNDLED
struct onetest {
struct entry_s {
const char *name;
test_func_t ptr;
entry_func_t ptr;
};
#endif
#endif /* HEADER_LIBTEST_FIRST_H */

View File

@@ -131,7 +131,7 @@ test_cleanup:
/* for debugging: */
/* #define SINGLETEST 9 */
CURLcode test(char *URL)
static CURLcode test_lib1156(char *URL)
{
CURLcode res;
CURL *curl;

View File

@@ -23,7 +23,7 @@
***************************************************************************/
#include "curlcheck.h"
CURLcode test(char *URL)
static CURLcode test_lib1301(char *URL)
{
int rc;
(void)URL;

View File

@@ -23,8 +23,6 @@
***************************************************************************/
#include "curlcheck.h"
#include <curl/curl.h>
static size_t print_httppost_callback(void *arg, const char *buf, size_t len)
{
fwrite(buf, len, 1, stdout);
@@ -32,7 +30,7 @@ static size_t print_httppost_callback(void *arg, const char *buf, size_t len)
return len;
}
CURLcode test(char *URL)
static CURLcode test_lib1308(char *URL)
{
CURLFORMcode rc;
int res;

View File

@@ -87,7 +87,7 @@ static size_t t1485_write_cb(char *ptr, size_t size, size_t nmemb, void *userp)
return len;
}
CURLcode test(char *URL)
static CURLcode test_lib1485(char *URL)
{
CURL *curls = NULL;
CURLcode res = CURLE_OK;

View File

@@ -27,7 +27,7 @@
#include "warnless.h"
#include "memdebug.h"
CURLcode test(char *URL)
static CURLcode test_lib1500(char *URL)
{
CURL *curls = NULL;
CURLM *multi = NULL;

View File

@@ -32,12 +32,12 @@
#undef TEST_HANG_TIMEOUT
#define TEST_HANG_TIMEOUT 30 * 1000
/* 500 milliseconds allowed. An extreme number but lets be really conservative
to allow old and slow machines to run this test too */
#define MAX_BLOCKED_TIME_MS 500
CURLcode test(char *URL)
static CURLcode test_lib1501(char *URL)
{
/* 500 milliseconds allowed. An extreme number but lets be really
conservative to allow old and slow machines to run this test too */
static const int MAX_BLOCKED_TIME_MS = 500;
CURL *handle = NULL;
CURLM *mhandle = NULL;
CURLcode res = CURLE_OK;

View File

@@ -37,7 +37,7 @@
#include "warnless.h"
#include "memdebug.h"
CURLcode test(char *URL)
static CURLcode test_lib1502(char *URL)
{
CURL *easy = NULL;
CURL *dup;

View File

@@ -27,13 +27,13 @@
#include "warnless.h"
#include "memdebug.h"
CURLcode test(char *URL)
static CURLcode test_lib1506(char *URL)
{
CURLcode res = CURLE_OK;
CURL *curl[NUM_HANDLES] = {0};
int running;
CURLM *m = NULL;
int i;
size_t i;
char target_url[256];
char dnsentry[256];
struct curl_slist *slist = NULL, *slist2;
@@ -43,9 +43,9 @@ CURLcode test(char *URL)
(void)URL;
/* Create fake DNS entries for serverX.example.com for all handles */
for(i = 0; i < NUM_HANDLES; i++) {
for(i = 0; i < CURL_ARRAYSIZE(curl); i++) {
curl_msnprintf(dnsentry, sizeof(dnsentry), "server%d.example.com:%s:%s",
i + 1, port, address);
(int)i + 1, port, address);
curl_mprintf("%s\n", dnsentry);
slist2 = curl_slist_append(slist, dnsentry);
if(!slist2) {
@@ -63,14 +63,14 @@ CURLcode test(char *URL)
multi_setopt(m, CURLMOPT_MAXCONNECTS, 3L);
/* get NUM_HANDLES easy handles */
for(i = 0; i < NUM_HANDLES; i++) {
/* get each easy handle */
for(i = 0; i < CURL_ARRAYSIZE(curl); i++) {
/* get an easy handle */
easy_init(curl[i]);
/* specify target */
curl_msnprintf(target_url, sizeof(target_url),
"http://server%d.example.com:%s/path/1506%04i",
i + 1, port, i + 1);
(int)i + 1, port, (int)i + 1);
target_url[sizeof(target_url) - 1] = '\0';
easy_setopt(curl[i], CURLOPT_URL, target_url);
/* go verbose */
@@ -83,7 +83,7 @@ CURLcode test(char *URL)
curl_mfprintf(stderr, "Start at URL 0\n");
for(i = 0; i < NUM_HANDLES; i++) {
for(i = 0; i < CURL_ARRAYSIZE(curl); i++) {
/* add handle to multi */
multi_add_handle(m, curl[i]);
@@ -121,7 +121,7 @@ test_cleanup:
/* proper cleanup sequence - type PB */
for(i = 0; i < NUM_HANDLES; i++) {
for(i = 0; i < CURL_ARRAYSIZE(curl); i++) {
curl_multi_remove_handle(m, curl[i]);
curl_easy_cleanup(curl[i]);
}

View File

@@ -36,8 +36,6 @@
#define RECIPIENT "<1507-recipient@example.com>"
#define MAILFROM "<1507-realuser@example.com>"
#define MULTI_PERFORM_HANG_TIMEOUT 60 * 1000
static size_t t1507_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
{
(void)ptr;
@@ -47,8 +45,10 @@ static size_t t1507_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
return CURL_READFUNC_ABORT;
}
CURLcode test(char *URL)
static CURLcode test_lib1507(char *URL)
{
static const int MULTI_PERFORM_HANG_TIMEOUT = 60 * 1000;
CURLcode res = CURLE_OK;
CURL *curl = NULL;
CURLM *mcurl = NULL;

View File

@@ -27,7 +27,7 @@
#include "warnless.h"
#include "memdebug.h"
CURLcode test(char *URL)
static CURLcode test_lib1508(char *URL)
{
CURLcode res = CURLE_OK;
CURLM *m = NULL;

View File

@@ -32,7 +32,7 @@ size_t WriteHeader(char *ptr, size_t size, size_t nmemb, void *stream);
static unsigned long realHeaderSize = 0;
CURLcode test(char *URL)
static CURLcode test_lib1509(char *URL)
{
long headerSize;
CURLcode code;

View File

@@ -27,10 +27,10 @@
#include "warnless.h"
#include "memdebug.h"
#define NUM_URLS 4
CURLcode test(char *URL)
static CURLcode test_lib1510(char *URL)
{
static const int NUM_URLS = 4;
CURLcode res = CURLE_OK;
CURL *curl = NULL;
int i;

View File

@@ -25,7 +25,7 @@
#include "memdebug.h"
CURLcode test(char *URL)
static CURLcode test_lib1511(char *URL)
{
long unmet;
CURL *curl = NULL;

View File

@@ -32,18 +32,15 @@
#include "memdebug.h"
#undef NUM_HANDLES
#define NUM_HANDLES 2
CURLcode test(char *URL)
static CURLcode test_lib1512(char *URL)
{
CURLcode res = CURLE_OK;
CURL *curl[NUM_HANDLES] = {NULL, NULL};
CURL *curl[2] = {NULL, NULL};
char *port = libtest_arg3;
char *address = libtest_arg2;
char dnsentry[256];
struct curl_slist *slist = NULL;
int i;
size_t i;
char target_url[256];
(void)URL; /* URL is setup in the code */
@@ -57,14 +54,14 @@ CURLcode test(char *URL)
curl_mprintf("%s\n", dnsentry);
slist = curl_slist_append(slist, dnsentry);
/* get NUM_HANDLES easy handles */
for(i = 0; i < NUM_HANDLES; i++) {
/* get each easy handle */
for(i = 0; i < CURL_ARRAYSIZE(curl); i++) {
/* get an easy handle */
easy_init(curl[i]);
/* specify target */
curl_msnprintf(target_url, sizeof(target_url),
"http://server.example.curl:%s/path/1512%04i",
port, i + 1);
port, (int)i + 1);
target_url[sizeof(target_url) - 1] = '\0';
easy_setopt(curl[i], CURLOPT_URL, target_url);
/* go verbose */
@@ -78,8 +75,8 @@ CURLcode test(char *URL)
/* make the first one populate the GLOBAL cache */
easy_setopt(curl[0], CURLOPT_RESOLVE, slist);
/* run NUM_HANDLES transfers */
for(i = 0; (i < NUM_HANDLES) && !res; i++) {
/* run each transfer */
for(i = 0; (i < CURL_ARRAYSIZE(curl)) && !res; i++) {
res = curl_easy_perform(curl[i]);
if(res)
goto test_cleanup;

View File

@@ -47,7 +47,7 @@ static int progressKiller(void *arg,
return 1;
}
CURLcode test(char *URL)
static CURLcode test_lib1513(char *URL)
{
CURL *curl;
CURLcode res = CURLE_OK;

View File

@@ -52,7 +52,7 @@ static size_t t1514_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
return 0; /* no more data left to deliver */
}
CURLcode test(char *URL)
static CURLcode test_lib1514(char *URL)
{
CURL *curl;
CURLcode result = CURLE_OK;

View File

@@ -101,7 +101,7 @@ test_cleanup:
return res;
}
CURLcode test(char *URL)
static CURLcode test_lib1515(char *URL)
{
CURLM *multi = NULL;
CURLcode res = CURLE_OK;

View File

@@ -51,7 +51,7 @@ static size_t t1517_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
return tocopy;
}
CURLcode test(char *URL)
static CURLcode test_lib1517(char *URL)
{
static const char testdata[] =
"this is what we post to the silly web server\n";

View File

@@ -37,7 +37,7 @@ static size_t t1518_write_cb(char *buffer, size_t size, size_t nitems,
return 0;
}
CURLcode test(char *URL)
static CURLcode test_lib1518(char *URL)
{
CURL *curl;
CURLcode res = CURLE_OK;

View File

@@ -71,7 +71,7 @@ static size_t t1520_read_cb(char *ptr, size_t size, size_t nmemb, void *userp)
return 0;
}
CURLcode test(char *URL)
static CURLcode test_lib1520(char *URL)
{
CURLcode res;
CURL *curl;

View File

@@ -47,7 +47,7 @@ static int sockopt_callback(void *clientp, curl_socket_t curlfd,
return CURL_SOCKOPT_OK;
}
CURLcode test(char *URL)
static CURLcode test_lib1522(char *URL)
{
static char g_Data[40 * 1024]; /* POST 40KB */

View File

@@ -55,7 +55,7 @@ static CURLcode run(CURL *hnd, long limit, long time)
return curl_easy_perform(hnd);
}
CURLcode test(char *URL)
static CURLcode test_lib1523(char *URL)
{
CURLcode ret;
CURL *hnd;

View File

@@ -45,7 +45,7 @@ static size_t t1525_read_cb(char *ptr, size_t size, size_t nmemb, void *stream)
return strlen(t1525_testdata);
}
CURLcode test(char *URL)
static CURLcode test_lib1525(char *URL)
{
CURL *curl = NULL;
CURLcode res = CURLE_FAILED_INIT;

View File

@@ -44,7 +44,7 @@ static size_t t1526_read_cb(char *ptr, size_t size, size_t nmemb, void *stream)
return strlen(t1526_testdata);
}
CURLcode test(char *URL)
static CURLcode test_lib1526(char *URL)
{
CURL *curl = NULL;
CURLcode res = CURLE_FAILED_INIT;

View File

@@ -44,7 +44,7 @@ static size_t t1527_read_cb(char *ptr, size_t size, size_t nmemb, void *stream)
return strlen(t1527_testdata);
}
CURLcode test(char *URL)
static CURLcode test_lib1527(char *URL)
{
CURL *curl = NULL;
CURLcode res = CURLE_FAILED_INIT;

View File

@@ -21,12 +21,11 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "test.h"
#include "memdebug.h"
CURLcode test(char *URL)
static CURLcode test_lib1528(char *URL)
{
CURL *curl = NULL;
CURLcode res = CURLE_FAILED_INIT;

View File

@@ -21,12 +21,11 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "test.h"
#include "memdebug.h"
CURLcode test(char *URL)
static CURLcode test_lib1529(char *URL)
{
CURL *curl = NULL;
CURLcode res = CURLE_FAILED_INIT;

View File

@@ -21,7 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#include "test.h"
#include "memdebug.h"
@@ -37,7 +36,7 @@ static curl_socket_t opensocket(void *clientp,
return CURL_SOCKET_BAD;
}
CURLcode test(char *URL)
static CURLcode test_lib1530(char *URL)
{
CURL *curl = NULL;
CURLcode res = CURLE_FAILED_INIT;

View File

@@ -28,7 +28,7 @@
#include "warnless.h"
#include "memdebug.h"
CURLcode test(char *URL)
static CURLcode test_lib1531(char *URL)
{
static char const testData[] = ".abc\0xyz";
static curl_off_t const testDataSize = sizeof(testData) - 1;

View File

@@ -27,7 +27,7 @@
/* Test CURLINFO_RESPONSE_CODE */
CURLcode test(char *URL)
static CURLcode test_lib1532(char *URL)
{
CURL *curl;
long httpcode;

View File

@@ -123,7 +123,7 @@ static CURLcode perform_and_check_connections(CURL *curl,
}
CURLcode test(char *URL)
static CURLcode test_lib1533(char *URL)
{
struct cb_data data;
CURL *curl = NULL;

View File

@@ -27,7 +27,7 @@
/* Test CURLINFO_FILETIME */
CURLcode test(char *URL)
static CURLcode test_lib1534(char *URL)
{
CURL *curl, *dupe = NULL;
long filetime;
@@ -110,7 +110,6 @@ CURLcode test(char *URL)
goto test_cleanup;
}
/* Test that a filetime is properly initialized on curl_easy_reset.
*/

View File

@@ -27,7 +27,7 @@
/* Test CURLINFO_PROTOCOL */
CURLcode test(char *URL)
static CURLcode test_lib1535(char *URL)
{
CURL *curl, *dupe = NULL;
long protocol;
@@ -113,7 +113,6 @@ CURLcode test(char *URL)
goto test_cleanup;
}
/* Test that a protocol is properly initialized on curl_easy_reset.
*/

View File

@@ -27,7 +27,7 @@
/* Test CURLINFO_SCHEME */
CURLcode test(char *URL)
static CURLcode test_lib1536(char *URL)
{
CURL *curl, *dupe = NULL;
char *scheme;
@@ -109,7 +109,6 @@ CURLcode test(char *URL)
goto test_cleanup;
}
/* Test that a scheme is properly initialized on curl_easy_reset.
*/

View File

@@ -25,7 +25,7 @@
#include "memdebug.h"
CURLcode test(char *URL)
static CURLcode test_lib1537(char *URL)
{
const unsigned char a[] = {0x2f, 0x3a, 0x3b, 0x3c, 0x3d, 0x3e, 0x3f,
0x91, 0xa2, 0xb3, 0xc4, 0xd5, 0xe6, 0xf7};

Some files were not shown because too many files have changed in this diff Show More