]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
make: clean tests better
authorDaniel Stenberg <daniel@haxx.se>
Sun, 6 Apr 2025 10:04:33 +0000 (12:04 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 6 Apr 2025 11:12:55 +0000 (13:12 +0200)
1. 'make clean' in the root dir now also invokes 'make clean' in the
tests subdir so that it cleans up better recursively. The Makefile.am
does not list 'tests' as a normal subdir to avoid building that
directory for a normal make invoke.

2. 'make clean' in the tests/libtest and tests/unit directories now
*explicitly* remove the unity build executables even if this is not a
unit build. This, because those files may be leftovers from previous
builds and such leftovers can otherwise linger around and since
'runtests.pl' dynamically acts differently based on the mere *presence*
of those files, they can keep you fooled for a while until you
realize...

Closes #16986

Makefile.am
tests/libtest/Makefile.am
tests/unit/Makefile.am

index d63ef632cb9a74e97b2ea21cd01a58d4a7f4b327..30f37578ce754929da67d697c21222a0b6750f09 100644 (file)
@@ -222,3 +222,6 @@ checksrc:
 tidy:
        (cd src && $(MAKE) tidy)
        (cd lib && $(MAKE) tidy)
+
+clean-local:
+       (cd tests && $(MAKE) clean)
index d3d7860afaa7dd497b78155d654ef7448c8997e2..a4f6edb7a0edbf3705a0d34824211ec75ec78dc8 100644 (file)
@@ -96,11 +96,13 @@ libstubgss_la_LIBADD =
 libstubgss_la_DEPENDENCIES =
 endif
 
+BUNDLE=libtests
+
 if USE_TEST_BUNDLES
 libtest_bundle.c: $(top_srcdir)/tests/mk-bundle.pl Makefile.inc $(FIRSTFILES) lib1521.c
        @PERL@ $(top_srcdir)/tests/mk-bundle.pl $(srcdir) > libtest_bundle.c
 
-noinst_PROGRAMS = libtests
+noinst_PROGRAMS = $(BUNDLE)
 nodist_libtests_SOURCES = libtest_bundle.c
 libtests_SOURCES = $(TESTUTIL) $(TSTTRACE)
 libtests_LDADD = $(TESTUTIL_LIBS)
@@ -133,3 +135,6 @@ if DEBUGBUILD
 # for debug builds, we scan the sources on all regular make invokes
 all-local: checksrc
 endif
+
+clean-local:
+       rm -f $(BUNDLE)
index 0e7605e7ee795d7bc287616e7d9f76ef44f4fb2a..3b4495c49ea00e4098305ee41b7962dd7562a7a6 100644 (file)
@@ -58,12 +58,14 @@ if CURLDEBUG
 AM_CPPFLAGS += -DCURLDEBUG
 endif
 
+BUNDLE=units
+
 if BUILD_UNITTESTS
 if USE_TEST_BUNDLES
 unit_bundle.c: $(top_srcdir)/tests/mk-bundle.pl Makefile.inc
        @PERL@ $(top_srcdir)/tests/mk-bundle.pl $(srcdir) > unit_bundle.c
 
-noinst_PROGRAMS = units
+noinst_PROGRAMS = $(BUNDLE)
 nodist_units_SOURCES = unit_bundle.c
 CLEANFILES = unit_bundle.c
 else
@@ -85,3 +87,6 @@ checksrc:
        $(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
          -W$(srcdir)/unit_bundle.c \
          $(srcdir)/*.[ch])
+
+clean-local:
+       rm -f $(BUNDLE)