]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tests: separate tunit tests from unit tests more
authorDaniel Stenberg <daniel@haxx.se>
Tue, 6 May 2025 13:03:46 +0000 (15:03 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 6 May 2025 15:25:22 +0000 (17:25 +0200)
- unit tests need no tool code as they are libcurl unit tests
- unit test 1621 is now tunit test 1621 instead, as it tests tool code
- build unit tests with BUILDING_LIBCURL as they pretent to be libcurl

Closes #17259

tests/data/test1621
tests/tunit/Makefile.inc
tests/tunit/tool1621.c [moved from tests/unit/unit1621.c with 100% similarity]
tests/unit/CMakeLists.txt
tests/unit/Makefile.am
tests/unit/Makefile.inc
tests/unit/unit3200.c

index 953440f29e27bc986de5b9bd70e74e5501b76e95..cfd6ccbd9dc4f04c0b854f6627818106d2d8ae29 100644 (file)
@@ -19,5 +19,8 @@ https
 <name>
 unit tests for stripcredentials from URL
 </name>
+<tool>
+tool%TESTNUMBER
+</tool>
 </client>
 </testcase>
index c28a16c42ea6cf7971748c1b3f096588a9235874..55dd1644a8124719734acd137d4c5ca051dfaeab 100644 (file)
@@ -29,8 +29,10 @@ FIRSTFILES = ../libtest/first.c
 TOOLFILES = $(FIRSTFILES)
 
 # These are all tool unit test programs
-TOOLPROGS = tool1394 tool1604
+TOOLPROGS = tool1394 tool1604 tool1621
 
 tool1394_SOURCES = tool1394.c $(TOOLFILES)
 
 tool1604_SOURCES = tool1604.c $(TOOLFILES)
+
+tool1621_SOURCES = tool1621.c $(TOOLFILES)
similarity index 100%
rename from tests/unit/unit1621.c
rename to tests/tunit/tool1621.c
index 10eafec5913cbeef4c2d9288293d5604abde3416..3e4c0de68b8bf875e48159a907cccb2f29083cbe 100644 (file)
@@ -39,6 +39,9 @@ if(CURL_TEST_BUNDLES)
   set(units_SOURCES "unit_bundle.c")
 endif()
 
+# unit tests are small pretend-libcurl-programs
+list(APPEND CURL_DEBUG_MACROS "BUILDING_LIBCURL")
+
 foreach(_target IN LISTS UNITPROGS)
   set(_target_name "${_target}")
   add_executable(${_target_name} EXCLUDE_FROM_ALL ${${_target}_SOURCES})
index 3b4495c49ea00e4098305ee41b7962dd7562a7a6..006722d77031ce43c5da61ea256c1ba751e5be7d 100644 (file)
@@ -46,11 +46,10 @@ CFLAGS += @CURL_CFLAG_EXTRAS@
 # Prevent LIBS from being used for all link targets
 LIBS = $(BLANK_AT_MAKETIME)
 
-LDADD = $(top_builddir)/src/libcurltool.la   \
-        $(top_builddir)/lib/libcurlu.la      \
+LDADD = $(top_builddir)/lib/libcurlu.la      \
         @LIBCURL_PC_LDFLAGS_PRIVATE@ @LIBCURL_PC_LIBS_PRIVATE@
 
-AM_CPPFLAGS += -DCURL_STATICLIB -DUNITTESTS
+AM_CPPFLAGS += -DCURL_STATICLIB -DUNITTESTS -DBUILDING_LIBCURL
 if DEBUGBUILD
 AM_CPPFLAGS += -DDEBUGBUILD
 endif
index 7d9f91df2c45fe3997816972f2d4fbf0c538840f..b44b1c55897205fbbf6fab638b26ebf1c222c29d 100644 (file)
@@ -37,7 +37,7 @@ UNITPROGS = unit1300          unit1302 unit1303 unit1304 unit1305 unit1307 \
  unit1399 \
  unit1600 unit1601 unit1602 unit1603          unit1605 unit1606 unit1607 \
  unit1608 unit1609 unit1610 unit1611 unit1612 unit1614 unit1615 unit1616 \
- unit1620 unit1621 \
+ unit1620 \
  unit1650 unit1651 unit1652 unit1653 unit1654 unit1655 unit1656 unit1657 \
  unit1658 \
  unit1660 unit1661 unit1663 unit1664 \
@@ -106,8 +106,6 @@ unit1616_SOURCES = unit1616.c $(UNITFILES)
 
 unit1620_SOURCES = unit1620.c $(UNITFILES)
 
-unit1621_SOURCES = unit1621.c $(UNITFILES)
-
 unit1650_SOURCES = unit1650.c $(UNITFILES)
 
 unit1651_SOURCES = unit1651.c $(UNITFILES)
index 30d6281c4f420993738c5f61bed2a829bdd99d53..674e1fa3dde930ec5e265cf3d6ec5afd024e6a12 100644 (file)
@@ -22,8 +22,6 @@
  *
  ***************************************************************************/
 #include "curlcheck.h"
-/* disable the curlx_get_line redefinitions for this unit test */
-#define BUILDING_LIBCURL
 #include "curl_get_line.h"
 #include "memdebug.h"