]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
cmake: re-add simple test target, and name it `tests` master
authorViktor Szakats <commit@vsz.me>
Sat, 2 Aug 2025 11:10:05 +0000 (13:10 +0200)
committerViktor Szakats <commit@vsz.me>
Sat, 2 Aug 2025 13:03:54 +0000 (15:03 +0200)
Before this patch there was no (easy) way to run tests without various
verbose options, hindering readability of the output due its length.

Unfortunately CMake reserves `test` as a target name, which was
the reason for its removal earlier. Re-add it with the name `tests`,
to have the functionality without the name collision.

Also add a `tests` target as an alias to `test` for autotools.

Ref: https://cmake.org/cmake/help/v4.1/policy/CMP0037.html
Follow-up to cfea4f2f4dc316c38694440ef2eed899a3e7d207 #6258
Closes #18145

tests/CMakeLists.txt
tests/Makefile.am

index cc812583c76bdf9b16324a2e4e5f590ff6763cfc..33c64906e814add3e3b4d20e98bdce3468abe431 100644 (file)
@@ -114,6 +114,7 @@ configure_file(
   "${CMAKE_CURRENT_SOURCE_DIR}/configurehelp.pm.in"
   "${CMAKE_CURRENT_BINARY_DIR}/configurehelp.pm" @ONLY)
 
   "${CMAKE_CURRENT_SOURCE_DIR}/configurehelp.pm.in"
   "${CMAKE_CURRENT_BINARY_DIR}/configurehelp.pm" @ONLY)
 
+curl_add_runtests(tests          "")  # Avoid 'test', which is a reserved target name in CMake
 curl_add_runtests(test-quiet     "-a -s")
 curl_add_runtests(test-am        "-a -am")
 curl_add_runtests(test-full      "-a -p -r")
 curl_add_runtests(test-quiet     "-a -s")
 curl_add_runtests(test-am        "-a -am")
 curl_add_runtests(test-full      "-a -p -r")
index 363a8562a8c0296f2dbe02d5dd56e415d239218b..58f24c29cee7713a6657078447a8bde7ec8b8fb5 100644 (file)
@@ -141,6 +141,9 @@ perlcheck:
 build-certs:
        (cd certs && $(MAKE))
 
 build-certs:
        (cd certs && $(MAKE))
 
+# alias for 'test' to match CMake, where 'test' is a reserved target
+tests: test
+
 test: perlcheck all
        $(TEST) $(TFLAGS)
 
 test: perlcheck all
        $(TEST) $(TFLAGS)