Skip to content

Commit

Permalink
t/Makefile: check helper scripts for non-portable shell commands too
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jens Lehmann authored and Junio C Hamano committed Jul 10, 2014
1 parent 6f92e5f commit cd78cea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion t/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
Expand Down

0 comments on commit cd78cea

Please sign in to comment.