]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: fixup tunit tests for cmake
authorViktor Szakats <commit@vsz.me>
Mon, 14 Apr 2025 12:11:49 +0000 (14:11 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 14 Apr 2025 19:31:39 +0000 (21:31 +0200)
Follow-up to 461ebbd336280ff843ec7971775e15f35134647d #16983

Closes #17051

tests/CMakeLists.txt
tests/runner.pm
tests/runtests.pl
tests/tunit/.gitignore
tests/tunit/CMakeLists.txt
tests/tunit/Makefile.am

index c598132b6de002d19619d3cacc2218a3d987f380..12ed61275f234b1acaf591571f0e219325644408 100644 (file)
@@ -34,6 +34,7 @@ add_subdirectory(http)
 add_subdirectory(http/clients)
 add_subdirectory(server)
 add_subdirectory(libtest)
+add_subdirectory(tunit)
 add_subdirectory(unit)
 add_subdirectory(certs)
 
index 8b7ab19bafec568e98b1bef5ef37620bf94588e7..bea6de709a06b55165189703427e86f428406b4b 100644 (file)
@@ -924,17 +924,17 @@ sub singletest_run {
             }
             $CMDLINE=$LIBDIR . $tool;
         }
-        elsif($tool =~ /^unit/) {
+        elsif($tool =~ /^tool/) {
             if($bundle) {
-                $tool = "units" . exe_ext('TOOL')
+                $tool = "tunits" . exe_ext('TOOL')
             }
-            $CMDLINE=$UNITDIR . $tool;
+            $CMDLINE=$TUNITDIR . $tool;
         }
-        elsif($tool =~ /^tool/) {
+        elsif($tool =~ /^unit/) {
             if($bundle) {
                 $tool = "units" . exe_ext('TOOL')
             }
-            $CMDLINE=$TUNITDIR . $tool;
+            $CMDLINE=$UNITDIR . $tool;
         }
 
         if(! -f $CMDLINE) {
index 7d9d6440e78e595179bc49c545ba385ba8d79a21..7ba2eb4284f43cddc088e41d3095be15fd27e38d 100755 (executable)
@@ -2518,7 +2518,7 @@ EOHELP
 }
 
 # Detect a test bundle build.
-# Do not look for 'units' because not all configurations build it.
+# Do not look for 'tunits' and 'units' because not all configurations build them.
 if(-e $LIBDIR . "libtests" . exe_ext('TOOL') &&
    -e $SRVDIR . "servers" . exe_ext('SRV')) {
     # use test bundles
index 7f5578093a4e94dba19843189a919d8f5693c1b3..f1cc07bf6823551c9653030eadf29627d9d1feda 100644 (file)
@@ -4,4 +4,4 @@
 
 /tool[0-9][0-9][0-9][0-9]
 tool_bundle.c
-units
+tunits
index 0164b2531e8ec912ffcbb7e79b4ab659e1a21619..2959615a9a920a13bbb1587b06ecbfd94f65b023 100644 (file)
 #
 ###########################################################################
 
-# Get 'TOOLPROGS', '*_SOURCES', 'FIRSTFILES' variables
+# Get 'TOOLPROGS', '*_SOURCES', 'TOOLFILES' variables
 curl_transform_makefile_inc("Makefile.inc" "${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
 include("${CMAKE_CURRENT_BINARY_DIR}/Makefile.inc.cmake")
 
 if(CURL_TEST_BUNDLES)
   add_custom_command(
     OUTPUT "tool_bundle.c"
-    COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" "${CMAKE_CURRENT_SOURCE_DIR}" > "unit_bundle.c"
+    COMMAND ${PERL_EXECUTABLE} "${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" "${CMAKE_CURRENT_SOURCE_DIR}" > "tool_bundle.c"
     DEPENDS
-      "${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" ${FIRSTFILES}
+      "${PROJECT_SOURCE_DIR}/tests/mk-bundle.pl" ${TOOLFILES}
       "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.inc"
     VERBATIM)
 
-  set(TOOLPROGS "units")
-  set(units_SOURCES "tool_bundle.c")
+  set(TOOLPROGS "tunits")
+  set(tunits_SOURCES "tool_bundle.c")
 endif()
 
-foreach(_target IN LISTS UNITPROGS)
+foreach(_target IN LISTS TOOLPROGS)
   set(_target_name "${_target}")
   add_executable(${_target_name} EXCLUDE_FROM_ALL ${${_target}_SOURCES})
   add_dependencies(testdeps ${_target_name})
@@ -49,6 +49,7 @@ foreach(_target IN LISTS UNITPROGS)
     "${PROJECT_SOURCE_DIR}/lib"            # for "curl_setup.h"
     "${PROJECT_SOURCE_DIR}/src"
     "${PROJECT_SOURCE_DIR}/tests/libtest"
+    "${PROJECT_SOURCE_DIR}/tests/unit"     # for curlcheck.h
   )
   set_property(TARGET ${_target_name} APPEND PROPERTY COMPILE_DEFINITIONS "${CURL_DEBUG_MACROS}")
   if(CURL_TEST_BUNDLES)
@@ -56,5 +57,5 @@ foreach(_target IN LISTS UNITPROGS)
   endif()
   set_target_properties(${_target_name} PROPERTIES
     OUTPUT_NAME "${_target}"
-    PROJECT_LABEL "Test unit ${_target}")
+    PROJECT_LABEL "Test tunit ${_target}")
 endforeach()
index 21d7744fe67f7913ba6a33a047ee61fc93009705..d910daa8d872b81b73874040df943f835ddf6f67 100644 (file)
@@ -64,8 +64,8 @@ if USE_TEST_BUNDLES
 tool_bundle.c: $(top_srcdir)/tests/mk-bundle.pl Makefile.inc
        @PERL@ $(top_srcdir)/tests/mk-bundle.pl $(srcdir) > tool_bundle.c
 
-noinst_PROGRAMS = units
-nodist_units_SOURCES = tool_bundle.c
+noinst_PROGRAMS = tunits
+nodist_tunits_SOURCES = tool_bundle.c
 CLEANFILES = tool_bundle.c
 else
 # Makefile.inc provides neat definitions