git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v2 1/2] t/Makefile: check helper scripts for non-portable shell commands too

From
Jens Lehmann <jens.lehmann@web.de>
Date
Jul 9, 2014, 19:34 UTC
Message-ID
<53BD9934.9050708@web.de>
In-Reply-To
<53BD9908.1060807@web.de>

Currently only the "t[0-9][0-9][0-9][0-9]-*.sh" scripts are tested for shell incompatibilities using the check-non-portable-shell.pl script. This makes it easy to miss non-POSIX constructs added to one of the t/*lib*.sh helper scripts, as they aren't automatically detected.

Fix that by adding a THELPERS variable containing all shell scripts that aren't tests and add these to the "test-lint-shell-syntax" target too.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
 t/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/t/Makefile b/t/Makefile
index 8fd1a72..7fa6692 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -29,6 +29,7 @@ TEST_RESULTS_DIRECTORY_SQ = $(subst ','\'',$(TEST_RESULTS_DIRECTORY))
 T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
 TSVN = $(sort $(wildcard t91[0-9][0-9]-*.sh))
 TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
+THELPERS = $(sort $(filter-out $(T),$(wildcard *.sh)))

 all: $(DEFAULT_TEST_TARGET)

@@ -65,7 +66,7 @@ test-lint-executable:
 		echo >&2 "non-executable tests:" $$bad; exit 1; }

 test-lint-shell-syntax:
-	@'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T)
+	@'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS)

 aggregate-results-and-cleanup: $(T)
 	$(MAKE) aggregate-results
-- 
2.0.1.476.gf051ede
Previous: Jens LehmannNext: Jens Lehmann
Message 8 of 10 in “always run all lint targets when running the test suite”
  1. 0/2 always run all lint targets when running the test suiteJens Lehmann, Jul 3, 2014
  2. 1/2 t/Makefile: check helper scripts for non-portable shell commands tooJens Lehmann, Jul 3, 2014
  3. 2/2 t/Makefile: always test all lint targets when running testsJens Lehmann, Jul 3, 2014
  4. Junio C HamanoJul 7, 2014
  5. Jens LehmannJul 8, 2014
  6. Junio C HamanoJul 9, 2014
  7. 0/2 always run all lint targets when running the test suiteJens Lehmann, Jul 9, 2014
  8. 1/2 t/Makefile: check helper scripts for non-portable shell commands tooJens Lehmann, Jul 9, 2014
  9. 2/2 t/Makefile: always test all lint targets when running testsJens Lehmann, Jul 9, 2014
  10. Jeff KingJul 9, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.