diff mbox series

[2/2] Makefile: adjust sed command for generating "clar-decls.h"

Message ID dda9b8e033c2e32e17dff73cad43211dd355d3ec.1728903464.git.ps@pks.im (mailing list archive)
State Superseded
Headers show
Series t/unit-tests: improve clar platform compatibility | expand

Commit Message

Patrick Steinhardt Oct. 14, 2024, 11:45 a.m. UTC
From: Alejandro R. Sedeño <asedeno@mit.edu>

This moves the end-of-line marker out of the captured group, matching
the start-of-line marker and for some reason fixing generation of
"clar-decls.h" on some older, more esoteric platforms.

Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Signed-off-by: Patrick Steinhardt <ps@pks.im>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Toon Claes Oct. 18, 2024, 3:45 p.m. UTC | #1
Patrick Steinhardt <ps@pks.im> writes:

> From: Alejandro R. Sedeño <asedeno@mit.edu>
>
> This moves the end-of-line marker out of the captured group, matching
> the start-of-line marker and for some reason fixing generation of
> "clar-decls.h" on some older, more esoteric platforms.
>
> Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
> Signed-off-by: Patrick Steinhardt <ps@pks.im>
> ---
>  Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index feeed6f9321..0101d349f38 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -3905,7 +3905,7 @@ GIT-TEST-SUITES: FORCE
>  
>  $(UNIT_TEST_DIR)/clar-decls.h: $(patsubst %,$(UNIT_TEST_DIR)/%.c,$(CLAR_TEST_SUITES)) GIT-TEST-SUITES
>  	$(QUIET_GEN)for suite in $(CLAR_TEST_SUITES); do \
> -		sed -ne "s/^\(void test_$${suite}__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)$$\)/extern \1;/p" $(UNIT_TEST_DIR)/$$suite.c; \
> +		sed -ne "s/^\(void test_$${suite}__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$$/extern \1;/p" $(UNIT_TEST_DIR)/$$suite.c; \
>  	done >$@
>  $(UNIT_TEST_DIR)/clar.suite: $(UNIT_TEST_DIR)/clar-decls.h
>  	$(QUIET_GEN)awk -f $(UNIT_TEST_DIR)/clar-generate.awk $< >$(UNIT_TEST_DIR)/clar.suite
> -- 
> 2.47.0.dirty

You're most likely aware, but this change needs to move when the patch
"Makefile: extract script to generate clar declarations" [1] is merged,
because this line then lives in t/unit-tests/generate-clar-decls.sh.

[1]: https://lore.kernel.org/git/7a619677c7af6ba8213a36208e20ab75c4318e38.1728985514.git.ps@pks.im/
Taylor Blau Oct. 18, 2024, 9:14 p.m. UTC | #2
On Fri, Oct 18, 2024 at 05:45:58PM +0200, Toon Claes wrote:
> You're most likely aware, but this change needs to move when the patch
> "Makefile: extract script to generate clar declarations" [1] is merged,
> because this line then lives in t/unit-tests/generate-clar-decls.sh.
>
> [1]: https://lore.kernel.org/git/7a619677c7af6ba8213a36208e20ab75c4318e38.1728985514.git.ps@pks.im/

I believe that is what Patrick suggested in:

  https://lore.kernel.org/git/cover.1728914219.git.ps@pks.im/

, no?

Thanks,
Taylor
Patrick Steinhardt Oct. 21, 2024, 7 a.m. UTC | #3
On Fri, Oct 18, 2024 at 05:14:40PM -0400, Taylor Blau wrote:
> On Fri, Oct 18, 2024 at 05:45:58PM +0200, Toon Claes wrote:
> > You're most likely aware, but this change needs to move when the patch
> > "Makefile: extract script to generate clar declarations" [1] is merged,
> > because this line then lives in t/unit-tests/generate-clar-decls.sh.
> >
> > [1]: https://lore.kernel.org/git/7a619677c7af6ba8213a36208e20ab75c4318e38.1728985514.git.ps@pks.im/
> 
> I believe that is what Patrick suggested in:
> 
>   https://lore.kernel.org/git/cover.1728914219.git.ps@pks.im/
> 
> , no?

Yup. I think it makes everyones life easier if I were to just merge
these two series together. I would've done so right from the start if I
noticed that they interact with each other, but only saw this at a later
point in time.

I'll send this out later today or early tomorrow.

Patrick
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index feeed6f9321..0101d349f38 100644
--- a/Makefile
+++ b/Makefile
@@ -3905,7 +3905,7 @@  GIT-TEST-SUITES: FORCE
 
 $(UNIT_TEST_DIR)/clar-decls.h: $(patsubst %,$(UNIT_TEST_DIR)/%.c,$(CLAR_TEST_SUITES)) GIT-TEST-SUITES
 	$(QUIET_GEN)for suite in $(CLAR_TEST_SUITES); do \
-		sed -ne "s/^\(void test_$${suite}__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)$$\)/extern \1;/p" $(UNIT_TEST_DIR)/$$suite.c; \
+		sed -ne "s/^\(void test_$${suite}__[a-zA-Z_0-9][a-zA-Z_0-9]*(void)\)$$/extern \1;/p" $(UNIT_TEST_DIR)/$$suite.c; \
 	done >$@
 $(UNIT_TEST_DIR)/clar.suite: $(UNIT_TEST_DIR)/clar-decls.h
 	$(QUIET_GEN)awk -f $(UNIT_TEST_DIR)/clar-generate.awk $< >$(UNIT_TEST_DIR)/clar.suite