cmake: add basic way to select pytests to run

Not documented and experimental, example:
`-D_CURL_PYTEST=/test_60_h3_proxy.py`

Ideally, this should be an env like `TFLAGS` and it should allow
selecting any test ID or a group of them, but so far could not figure
out how even a basic env could work.

Closes #21818
This commit is contained in:
Viktor Szakats 2026-05-31 20:44:57 +02:00
parent 2802e65f6d
commit 5364e6e60e
No known key found for this signature in database

View file

@ -110,7 +110,7 @@ function(curl_add_pytests _targetname _test_flags)
endif()
string(REPLACE " " ";" _test_flags_list "${_test_flags}")
add_custom_target(${_targetname}
COMMAND pytest ${_test_flags_list} "${CMAKE_CURRENT_SOURCE_DIR}/http"
COMMAND pytest ${_test_flags_list} "${CMAKE_CURRENT_SOURCE_DIR}/http${_CURL_PYTEST}"
DEPENDS "${_depends}"
VERBATIM USES_TERMINAL
)