]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: add basic way to select pytests to run
authorViktor Szakats <commit@vsz.me>
Sun, 31 May 2026 18:44:57 +0000 (20:44 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 1 Jun 2026 13:07:17 +0000 (15:07 +0200)
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

tests/CMakeLists.txt

index e75ca4e14ec9899f4bcaa28aa938109b558e9200..6de7f96d0a2674e0b6eb268404d8980014dee2e9 100644 (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
   )