cmake: rename testbins target to tt, restore internal option

To make it easy to type. The internal option is used in CI.

Follow-up to aae361242f #20708

Closes #20768
This commit is contained in:
Viktor Szakats 2026-02-28 01:33:05 +01:00
parent 7a80082471
commit 1b35c9e1e3
No known key found for this signature in database
8 changed files with 17 additions and 13 deletions

View file

@ -63,7 +63,7 @@ This release includes the following bugfixes:
o cmake: normalize uppercase hex winver (for display) [191] o cmake: normalize uppercase hex winver (for display) [191]
o cmake: omit `curl.rc` from curltool lib [209] o cmake: omit `curl.rc` from curltool lib [209]
o cmake: reference OpenSSL and ZLIB imported targets only when enabled [41] o cmake: reference OpenSSL and ZLIB imported targets only when enabled [41]
o cmake: replace internal option with a new `testbins` target [220] o cmake: replace internal option with a new `tt` (test tools) target [220]
o cmake: silence potential unused var warnings in C++ test snippet [201] o cmake: silence potential unused var warnings in C++ test snippet [201]
o cmake: silence silly Apple clang warnings in C89 mode, test in CI [14] o cmake: silence silly Apple clang warnings in C89 mode, test in CI [14]
o cmake: silence useless compiler warnings triggered by the FASTBuild generator [43] o cmake: silence useless compiler warnings triggered by the FASTBuild generator [43]

View file

@ -552,12 +552,12 @@ Note: These variables are internal and subject to change.
## Useful build targets ## Useful build targets
- `testbins`: Build test binaries (servers, tools).
Individual targets: `curlinfo`, `libtests`, `servers`, `tunits`, `units`
- `testdeps`: Build test dependencies (test binaries, test certificates). - `testdeps`: Build test dependencies (test binaries, test certificates).
Test certificates: `build-certs` (clean with `clean-certs`) Test certificates: `build-certs` (clean with `clean-certs`)
- `tests`: Run tests (`runtests.pl`). Customize via the `TFLAGS` environment variable, e.g. `TFLAGS=1621`. - `tests`: Run tests (`runtests.pl`). Customize via the `TFLAGS` environment variable, e.g. `TFLAGS=1621`.
Other flavors: `test-am`, `test-ci`, `test-event`, `test-full`, `test-nonflaky`, `test-quiet`, `test-torture` Other flavors: `test-am`, `test-ci`, `test-event`, `test-full`, `test-nonflaky`, `test-quiet`, `test-torture`
- `tt`: Build test binaries (servers, tools).
Individual targets: `curlinfo`, `libtests`, `servers`, `tunits`, `units`
- `curl-pytest`: Run tests (pytest). - `curl-pytest`: Run tests (pytest).
Other flavor: `curl-test-ci` Other flavor: `curl-test-ci`
- `curl-examples`: Build examples - `curl-examples`: Build examples

View file

@ -29,21 +29,21 @@ mark_as_advanced(TEST_NGHTTPX)
# Consumed variables: TEST_NGHTTPX # Consumed variables: TEST_NGHTTPX
configure_file("config.in" "${CMAKE_CURRENT_BINARY_DIR}/config" @ONLY) configure_file("config.in" "${CMAKE_CURRENT_BINARY_DIR}/config" @ONLY)
add_custom_target(testbins) add_custom_target(tt)
if(BUILD_CURL_EXE) if(BUILD_CURL_EXE)
add_dependencies(testbins "curlinfo") add_dependencies(tt "curlinfo")
endif() endif()
if(CURL_BUILD_EVERYTHING) if(CURL_BUILD_EVERYTHING)
set_target_properties(testbins PROPERTIES EXCLUDE_FROM_ALL FALSE) set_target_properties(tt PROPERTIES EXCLUDE_FROM_ALL FALSE)
endif() endif()
if(CURL_CLANG_TIDY) if(CURL_CLANG_TIDY)
add_custom_target(tests-clang-tidy) add_custom_target(tests-clang-tidy)
add_dependencies(testbins tests-clang-tidy) add_dependencies(tt tests-clang-tidy)
endif() endif()
add_custom_target(testdeps) add_custom_target(testdeps)
add_dependencies(testdeps "testbins") add_dependencies(testdeps "tt")
add_subdirectory(http) add_subdirectory(http)
add_subdirectory(server) add_subdirectory(server)

View file

@ -31,7 +31,11 @@ add_custom_command(OUTPUT ${GENERATEDCERTS}
VERBATIM VERBATIM
) )
add_custom_target(build-certs DEPENDS ${GENERATEDCERTS}) add_custom_target(build-certs DEPENDS ${GENERATEDCERTS})
add_dependencies(testdeps build-certs)
option(_CURL_SKIP_BUILD_CERTS "Skip building certs with testdeps" OFF) # Internal option to increase perf for build tests
if(NOT _CURL_SKIP_BUILD_CERTS)
add_dependencies(testdeps build-certs)
endif()
add_custom_target(clean-certs add_custom_target(clean-certs
COMMAND ${CMAKE_COMMAND} -E remove ${GENERATEDCERTS} COMMAND ${CMAKE_COMMAND} -E remove ${GENERATEDCERTS}

View file

@ -52,7 +52,7 @@ add_custom_command(OUTPUT "${BUNDLE}.c"
VERBATIM) VERBATIM)
add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c") add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c")
add_dependencies(testbins ${BUNDLE}) add_dependencies(tt ${BUNDLE})
target_link_libraries(${BUNDLE} ${LIB_SELECTED} ${CURL_LIBS}) target_link_libraries(${BUNDLE} ${LIB_SELECTED} ${CURL_LIBS})
target_include_directories(${BUNDLE} PRIVATE target_include_directories(${BUNDLE} PRIVATE
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"

View file

@ -39,7 +39,7 @@ add_custom_command(OUTPUT "${BUNDLE}.c"
VERBATIM) VERBATIM)
add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c") add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c")
add_dependencies(testbins ${BUNDLE}) add_dependencies(tt ${BUNDLE})
target_link_libraries(${BUNDLE} ${CURL_NETWORK_AND_TIME_LIBS}) target_link_libraries(${BUNDLE} ${CURL_NETWORK_AND_TIME_LIBS})
target_include_directories(${BUNDLE} PRIVATE target_include_directories(${BUNDLE} PRIVATE
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"

View file

@ -39,7 +39,7 @@ add_custom_command(OUTPUT "${BUNDLE}.c"
VERBATIM) VERBATIM)
add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c") add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c")
add_dependencies(testbins ${BUNDLE}) add_dependencies(tt ${BUNDLE})
target_link_libraries(${BUNDLE} curltool ${LIB_SELECTED}) target_link_libraries(${BUNDLE} curltool ${LIB_SELECTED})
target_include_directories(${BUNDLE} PRIVATE target_include_directories(${BUNDLE} PRIVATE
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h" "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h"

View file

@ -40,7 +40,7 @@ add_custom_command(OUTPUT "${BUNDLE}.c"
add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c") add_executable(${BUNDLE} EXCLUDE_FROM_ALL "${BUNDLE}.c")
add_dependencies(${BUNDLE} curlu-unitprotos) add_dependencies(${BUNDLE} curlu-unitprotos)
add_dependencies(testbins ${BUNDLE}) add_dependencies(tt ${BUNDLE})
target_link_libraries(${BUNDLE} curlu) target_link_libraries(${BUNDLE} curlu)
target_include_directories(${BUNDLE} PRIVATE target_include_directories(${BUNDLE} PRIVATE
"${PROJECT_BINARY_DIR}/lib" # for "curl_config.h", "unitprotos.h" "${PROJECT_BINARY_DIR}/lib" # for "curl_config.h", "unitprotos.h"