On 7/20/19 9:27 AM, Akim Demaille wrote:
> # Ensure that tests call the print_ver_ function for programs which are
> # actually used in that test.
> sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
> - @git grep -w print_ver_ $(srcdir)/tests \
> + @cd $(srcdir) \
> + && git -C grep -w print_ver_ tests \
> | sed 's#:print_ver_##' \
> | { fail=0; \
> while read file name; do \
'git -C' is lacking the SRCDIR argument.
The attached fixes it.
Have a nice day,
Berny
>From 4f4475f2ffad417e021d08fbf4a742bda48b10ee Mon Sep 17 00:00:00 2001
From: Bernhard Voelker
Date: Tue, 6 Aug 2019 22:23:36 +0200
Subject: [PATCH] maint: fix error in syntax-check checking
The previous commit introduced a bug into the following syntax-check,
and thus effectively turned it off:
$ make sc_prohibit_test_calls_print_ver_with_irrelevant_argument; \
echo $?
prohibit_test_calls_print_ver_with_irrelevant_argument
fatal: cannot change to 'grep': No such file or directory
0
* cfg.mk (sc_prohibit_test_calls_print_ver_with_irrelevant_argument):
Remove changing directory, and pass $(srcdir) as argument to 'git -C'.
---
cfg.mk | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/cfg.mk b/cfg.mk
index b589b40e3..2bc933c8b 100644
--- a/cfg.mk
+++ b/cfg.mk
@@ -635,8 +635,7 @@ sc_prohibit_test_background_without_cleanup_:
# Ensure that tests call the print_ver_ function for programs which are
# actually used in that test.
sc_prohibit_test_calls_print_ver_with_irrelevant_argument:
- @cd $(srcdir) \
- && git -C grep -w print_ver_ tests\
+ @git -C $(srcdir) grep -w print_ver_ tests \
| sed 's#:print_ver_##' \
| { fail=0; \
while read file name; do \
--
2.22.0