diff mbox series

t/Makefile: remove 'test-results' on 'make clean'

Message ID 20220920105407.4700-1-szeder.dev@gmail.com (mailing list archive)
State Superseded
Headers show
Series t/Makefile: remove 'test-results' on 'make clean' | expand

Commit Message

SZEDER Gábor Sept. 20, 2022, 10:54 a.m. UTC
The 't/test-results' directory and its contents are by-products of the
test process, so 'make clean' should remove them, but, alas, this has
been broken since ee65b194d (t/Makefile: don't remove test-results in
"clean-except-prove-cache", 2022-07-28).

The 'clean' target in 't/Makefile' was not directly responsible for
removing the 'test-results' directory, but relied on its dependency
'clean-except-prove-cache' to do that [1].  ee65b194d broke this,
because it only removed the 'rm -r test-results' command from the
'clean-except-prove-cache' target instead of moving it to the 'clean'
target, resulting in stray 't/test-results' directories.

Add that missing cleanup command to 't/Makefile', and all sub-Makefiles
touched by ee65b194d as well.

[1] 60f26f6348 (t/Makefile: retain cache t/.prove across prove runs,
                2012-05-02)

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
---
 contrib/scalar/t/Makefile  | 1 +
 contrib/subtree/t/Makefile | 1 +
 t/Makefile                 | 1 +
 3 files changed, 3 insertions(+)

Comments

Jeff King Sept. 20, 2022, 7:51 p.m. UTC | #1
On Tue, Sep 20, 2022 at 12:54:07PM +0200, SZEDER Gábor wrote:

> The 't/test-results' directory and its contents are by-products of the
> test process, so 'make clean' should remove them, but, alas, this has
> been broken since ee65b194d (t/Makefile: don't remove test-results in
> "clean-except-prove-cache", 2022-07-28).

I don't have that commit. I assume you mean fee65b194d, and what you
have here was a version before it hit 'next'.

> Add that missing cleanup command to 't/Makefile', and all sub-Makefiles
> touched by ee65b194d as well.

Ditto here.

>  contrib/scalar/t/Makefile  | 1 +
>  contrib/subtree/t/Makefile | 1 +
>  t/Makefile                 | 1 +

That patch itself looks sensible to me.

-Peff
SZEDER Gábor Sept. 20, 2022, 8:11 p.m. UTC | #2
On Tue, Sep 20, 2022 at 03:51:14PM -0400, Jeff King wrote:
> On Tue, Sep 20, 2022 at 12:54:07PM +0200, SZEDER Gábor wrote:
> 
> > The 't/test-results' directory and its contents are by-products of the
> > test process, so 'make clean' should remove them, but, alas, this has
> > been broken since ee65b194d (t/Makefile: don't remove test-results in
> > "clean-except-prove-cache", 2022-07-28).
> 
> I don't have that commit.

Uh-oh.  Me neither :)

> I assume you mean fee65b194d, and what you
> have here was a version before it hit 'next'.

Looking at the reflog, it seems that while rewording the commit
message I inadvertently deleted the first character of the SHA1.

> > Add that missing cleanup command to 't/Makefile', and all sub-Makefiles
> > touched by ee65b194d as well.
> 
> Ditto here.
> 
> >  contrib/scalar/t/Makefile  | 1 +
> >  contrib/subtree/t/Makefile | 1 +
> >  t/Makefile                 | 1 +
> 
> That patch itself looks sensible to me.
> 
> -Peff
Jeff King Sept. 20, 2022, 8:42 p.m. UTC | #3
On Tue, Sep 20, 2022 at 10:11:50PM +0200, SZEDER Gábor wrote:

> On Tue, Sep 20, 2022 at 03:51:14PM -0400, Jeff King wrote:
> > On Tue, Sep 20, 2022 at 12:54:07PM +0200, SZEDER Gábor wrote:
> > 
> > > The 't/test-results' directory and its contents are by-products of the
> > > test process, so 'make clean' should remove them, but, alas, this has
> > > been broken since ee65b194d (t/Makefile: don't remove test-results in
> > > "clean-except-prove-cache", 2022-07-28).
> > 
> > I don't have that commit.
> 
> Uh-oh.  Me neither :)
> 
> > I assume you mean fee65b194d, and what you
> > have here was a version before it hit 'next'.
> 
> Looking at the reflog, it seems that while rewording the commit
> message I inadvertently deleted the first character of the SHA1.

Heh. You'd think I would have notice the similarity when pasting in the
new one. :) But yeah, that is definitely what happened.

-Peff
diff mbox series

Patch

diff --git a/contrib/scalar/t/Makefile b/contrib/scalar/t/Makefile
index 1ed174a8cf..e0bf2e32cb 100644
--- a/contrib/scalar/t/Makefile
+++ b/contrib/scalar/t/Makefile
@@ -46,6 +46,7 @@  clean-except-prove-cache:
 	$(RM) -r valgrind/bin
 
 clean: clean-except-prove-cache
+	$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
 	$(RM) .prove
 
 test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax
diff --git a/contrib/subtree/t/Makefile b/contrib/subtree/t/Makefile
index 3d278bb0ed..4655e0987b 100644
--- a/contrib/subtree/t/Makefile
+++ b/contrib/subtree/t/Makefile
@@ -51,6 +51,7 @@  clean-except-prove-cache:
 	$(RM) -r valgrind/bin
 
 clean: clean-except-prove-cache
+	$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
 	$(RM) .prove
 
 test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax
diff --git a/t/Makefile b/t/Makefile
index 1c80c0c79a..cb04481114 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -66,6 +66,7 @@  clean-except-prove-cache: clean-chainlint
 	$(RM) -r valgrind/bin
 
 clean: clean-except-prove-cache
+	$(RM) -r '$(TEST_RESULTS_DIRECTORY_SQ)'
 	$(RM) .prove
 
 clean-chainlint: