public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix tests-clean Makefile target (bug 30545)
@ 2023-06-15 15:25 Maxim Kuvyrkov
  2023-06-21 12:54 ` Adhemerval Zanella Netto
  2023-06-26 13:02 ` Carlos O'Donell
  0 siblings, 2 replies; 3+ messages in thread
From: Maxim Kuvyrkov @ 2023-06-15 15:25 UTC (permalink / raw)
  To: libc-alpha; +Cc: Carlos O'Donell, Maxim Kuvyrkov

This patch improves tests-clean Makefile target to reliably clean
test artifacts from a build directory.  Before this patch tests-clean
missed around 3k (out of total 9k) .out and .test-result files.

Signed-off-by: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>
---
 Makefile  |  5 ++++-
 Makerules | 23 +++++------------------
 2 files changed, 9 insertions(+), 19 deletions(-)

diff --git a/Makefile b/Makefile
index 523efd42c1..f324df7a1f 100644
--- a/Makefile
+++ b/Makefile
@@ -518,7 +518,10 @@ mostlyclean: parent-mostlyclean
 	@$(MAKE) subdir_mostlyclean no_deps=t
 	-rm -f $(postclean)
 
-tests-clean:
+# Remove test artifacts from the whole glibc build.
+# do-tests-clean removes test artifacts from top-level directory, and
+# subdir_testclean removes them from individual sub-directories.
+tests-clean: do-tests-clean
 	@$(MAKE) subdir_testclean no_deps=t
 
 ifneq (,$(CXX))
diff --git a/Makerules b/Makerules
index 2ccf26d320..018780c818 100644
--- a/Makerules
+++ b/Makerules
@@ -1334,18 +1334,13 @@ echo-headers:
 clean: common-clean
 mostlyclean: common-mostlyclean
 
+# Remove test artifacts from a given directory
 do-tests-clean:
-	-rm -f $(addprefix $(objpfx),$(addsuffix .out,$(tests) \
-						      $(tests-internal) \
-						      $(xtests) \
-						      $(test-srcs)) \
-				     $(addsuffix .test-result,$(tests) \
-							      $(tests-internal) \
-							      $(xtests) \
-							      $(test-srcs)))
+	-find $(objpfx) -name '*.out' -delete
+	-find $(objpfx) -name '*.test-result' -delete
 
 # Remove the object files.
-common-mostlyclean:
+common-mostlyclean: do-tests-clean
 	-rm -f $(addprefix $(objpfx),$(tests) $(tests-internal) $(xtests) \
 				     $(test-srcs) \
 				     $(others) $(sysdep-others) stubs \
@@ -1354,15 +1349,7 @@ common-mostlyclean:
 						    $(xtests) \
 						    $(test-srcs) \
 						    $(others) \
-						    $(sysdep-others)) \
-				     $(addsuffix .out,$(tests) \
-						      $(tests-internal) \
-						      $(xtests) \
-						      $(test-srcs)) \
-				     $(addsuffix .test-result,$(tests) \
-							      $(tests-internal) \
-							      $(xtests) \
-							      $(test-srcs)))
+						    $(sysdep-others)))
 	-rm -f $(addprefix $(objpfx),$(extra-objs) $(extra-test-objs) \
 				     $(install-lib) $(install-lib.so) \
 				     $(install-lib.so:%.so=%_pic.a))
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix tests-clean Makefile target (bug 30545)
  2023-06-15 15:25 [PATCH] Fix tests-clean Makefile target (bug 30545) Maxim Kuvyrkov
@ 2023-06-21 12:54 ` Adhemerval Zanella Netto
  2023-06-26 13:02 ` Carlos O'Donell
  1 sibling, 0 replies; 3+ messages in thread
From: Adhemerval Zanella Netto @ 2023-06-21 12:54 UTC (permalink / raw)
  To: Maxim Kuvyrkov, libc-alpha; +Cc: Carlos O'Donell



On 15/06/23 12:25, Maxim Kuvyrkov via Libc-alpha wrote:
> This patch improves tests-clean Makefile target to reliably clean
> test artifacts from a build directory.  Before this patch tests-clean
> missed around 3k (out of total 9k) .out and .test-result files.
> 
> Signed-off-by: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>

I noticed that even by cleaning both *.out and *.test-result, some tests
are still not trigger again:

--- /tmp/old    2023-06-21 09:45:14.665505755 -0300
+++ /tmp/new    2023-06-21 09:45:09.381406461 -0300
@@ -21,11 +21,7 @@
 ./catgets/check-installed-headers-cxx.test-result
 ./catgets/check-obsolete-constructs.test-result
 ./catgets/check-wrapper-headers.test-result
-./catgets/de/libc.cat.test-result
-./catgets/sample.SJIS.cat.test-result
 ./catgets/test-gencat.test-result
-./catgets/test1.cat.test-result
-./catgets/test2.cat.test-result
 ./catgets/tst-catgets-mem.test-result
 ./catgets/tst-catgets.test-result
 ./check-installed-headers-c.test-result
[...]
@@ -1830,108 +1806,12 @@
 ./locale/tst-locale-locpath.test-result
 ./locale/tst-localedef-path-norm.test-result
 ./locale/tst-locname.test-result
-./localedata/C.UTF-8/LC_CTYPE.test-result
-./localedata/am_ET.UTF-8/LC_CTYPE.test-result
-./localedata/az_AZ.UTF-8/LC_CTYPE.test-result
-./localedata/be_BY.UTF-8/LC_CTYPE.test-result
-./localedata/ber_DZ.UTF-8/LC_CTYPE.test-result
-./localedata/ber_MA.UTF-8/LC_CTYPE.test-result
-./localedata/bg_BG.UTF-8/LC_CTYPE.test-result
-./localedata/br_FR.UTF-8/LC_CTYPE.test-result
-./localedata/bs_BA.UTF-8/LC_CTYPE.test-result
 ./localedata/bug-iconv-trans.test-result
 ./localedata/bug-setlocale1-static.test-result
 ./localedata/bug-setlocale1.test-result
 ./localedata/bug-usesetlocale.test-result
[...]

Although it is because they do not really to (they are requirements for
other tests and since code has not change they are not regenerated).

So LGTM, thanks.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>


> ---
>  Makefile  |  5 ++++-
>  Makerules | 23 +++++------------------
>  2 files changed, 9 insertions(+), 19 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 523efd42c1..f324df7a1f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -518,7 +518,10 @@ mostlyclean: parent-mostlyclean
>  	@$(MAKE) subdir_mostlyclean no_deps=t
>  	-rm -f $(postclean)
>  
> -tests-clean:
> +# Remove test artifacts from the whole glibc build.
> +# do-tests-clean removes test artifacts from top-level directory, and
> +# subdir_testclean removes them from individual sub-directories.
> +tests-clean: do-tests-clean
>  	@$(MAKE) subdir_testclean no_deps=t
>  
>  ifneq (,$(CXX))
> diff --git a/Makerules b/Makerules
> index 2ccf26d320..018780c818 100644
> --- a/Makerules
> +++ b/Makerules
> @@ -1334,18 +1334,13 @@ echo-headers:
>  clean: common-clean
>  mostlyclean: common-mostlyclean
>  
> +# Remove test artifacts from a given directory
>  do-tests-clean:
> -	-rm -f $(addprefix $(objpfx),$(addsuffix .out,$(tests) \
> -						      $(tests-internal) \
> -						      $(xtests) \
> -						      $(test-srcs)) \
> -				     $(addsuffix .test-result,$(tests) \
> -							      $(tests-internal) \
> -							      $(xtests) \
> -							      $(test-srcs)))
> +	-find $(objpfx) -name '*.out' -delete
> +	-find $(objpfx) -name '*.test-result' -delete
>  
>  # Remove the object files.
> -common-mostlyclean:
> +common-mostlyclean: do-tests-clean
>  	-rm -f $(addprefix $(objpfx),$(tests) $(tests-internal) $(xtests) \
>  				     $(test-srcs) \
>  				     $(others) $(sysdep-others) stubs \
> @@ -1354,15 +1349,7 @@ common-mostlyclean:
>  						    $(xtests) \
>  						    $(test-srcs) \
>  						    $(others) \
> -						    $(sysdep-others)) \
> -				     $(addsuffix .out,$(tests) \
> -						      $(tests-internal) \
> -						      $(xtests) \
> -						      $(test-srcs)) \
> -				     $(addsuffix .test-result,$(tests) \
> -							      $(tests-internal) \
> -							      $(xtests) \
> -							      $(test-srcs)))
> +						    $(sysdep-others)))
>  	-rm -f $(addprefix $(objpfx),$(extra-objs) $(extra-test-objs) \
>  				     $(install-lib) $(install-lib.so) \
>  				     $(install-lib.so:%.so=%_pic.a))

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Fix tests-clean Makefile target (bug 30545)
  2023-06-15 15:25 [PATCH] Fix tests-clean Makefile target (bug 30545) Maxim Kuvyrkov
  2023-06-21 12:54 ` Adhemerval Zanella Netto
@ 2023-06-26 13:02 ` Carlos O'Donell
  1 sibling, 0 replies; 3+ messages in thread
From: Carlos O'Donell @ 2023-06-26 13:02 UTC (permalink / raw)
  To: Maxim Kuvyrkov, libc-alpha

On 6/15/23 11:25, Maxim Kuvyrkov wrote:
> This patch improves tests-clean Makefile target to reliably clean
> test artifacts from a build directory.  Before this patch tests-clean
> missed around 3k (out of total 9k) .out and .test-result files.
> 
> Signed-off-by: Maxim Kuvyrkov <maxim.kuvyrkov@linaro.org>

LGTM. Better than before. I saw Adhemerval's notes.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  Makefile  |  5 ++++-
>  Makerules | 23 +++++------------------
>  2 files changed, 9 insertions(+), 19 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 523efd42c1..f324df7a1f 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -518,7 +518,10 @@ mostlyclean: parent-mostlyclean
>  	@$(MAKE) subdir_mostlyclean no_deps=t
>  	-rm -f $(postclean)
>  
> -tests-clean:
> +# Remove test artifacts from the whole glibc build.
> +# do-tests-clean removes test artifacts from top-level directory, and
> +# subdir_testclean removes them from individual sub-directories.
> +tests-clean: do-tests-clean

OK.

>  	@$(MAKE) subdir_testclean no_deps=t
>  
>  ifneq (,$(CXX))
> diff --git a/Makerules b/Makerules
> index 2ccf26d320..018780c818 100644
> --- a/Makerules
> +++ b/Makerules
> @@ -1334,18 +1334,13 @@ echo-headers:
>  clean: common-clean
>  mostlyclean: common-mostlyclean
>  
> +# Remove test artifacts from a given directory
>  do-tests-clean:
> -	-rm -f $(addprefix $(objpfx),$(addsuffix .out,$(tests) \
> -						      $(tests-internal) \
> -						      $(xtests) \
> -						      $(test-srcs)) \
> -				     $(addsuffix .test-result,$(tests) \
> -							      $(tests-internal) \
> -							      $(xtests) \
> -							      $(test-srcs)))
> +	-find $(objpfx) -name '*.out' -delete
> +	-find $(objpfx) -name '*.test-result' -delete

OK. And faster!

>  
>  # Remove the object files.
> -common-mostlyclean:
> +common-mostlyclean: do-tests-clean
>  	-rm -f $(addprefix $(objpfx),$(tests) $(tests-internal) $(xtests) \
>  				     $(test-srcs) \
>  				     $(others) $(sysdep-others) stubs \
> @@ -1354,15 +1349,7 @@ common-mostlyclean:
>  						    $(xtests) \
>  						    $(test-srcs) \
>  						    $(others) \
> -						    $(sysdep-others)) \
> -				     $(addsuffix .out,$(tests) \
> -						      $(tests-internal) \
> -						      $(xtests) \
> -						      $(test-srcs)) \
> -				     $(addsuffix .test-result,$(tests) \
> -							      $(tests-internal) \
> -							      $(xtests) \
> -							      $(test-srcs)))
> +						    $(sysdep-others)))

OK. We've already done this.

>  	-rm -f $(addprefix $(objpfx),$(extra-objs) $(extra-test-objs) \
>  				     $(install-lib) $(install-lib.so) \
>  				     $(install-lib.so:%.so=%_pic.a))

-- 
Cheers,
Carlos.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-06-26 13:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15 15:25 [PATCH] Fix tests-clean Makefile target (bug 30545) Maxim Kuvyrkov
2023-06-21 12:54 ` Adhemerval Zanella Netto
2023-06-26 13:02 ` Carlos O'Donell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).