From: Junio C Hamano Date: Thu, 10 Jan 2013 21:47:04 +0000 (-0800) Subject: Merge branch 'tb/test-shell-lint' X-Git-Tag: v1.8.2-rc0~149 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/4249d850cff0d1d36b3a9c4cf38066c50365cfd1?ds=inline;hp=-c Merge branch 'tb/test-shell-lint' Check for common mistakes in the test scripts, based on simple pattern-matching. * tb/test-shell-lint: test: Add check-non-portable-shell.pl --- 4249d850cff0d1d36b3a9c4cf38066c50365cfd1 diff --combined t/Makefile index 5c6de8169b,a43becba9d..1923cc104b --- a/t/Makefile +++ b/t/Makefile @@@ -13,10 -13,10 +13,11 @@@ TAR ?= $(TAR RM ?= rm -f PROVE ?= prove DEFAULT_TEST_TARGET ?= test +TEST_LINT ?= test-lint-duplicates test-lint-executable # Shell quote; SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH)) + PERL_PATH_SQ = $(subst ','\'',$(PERL_PATH)) T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)) TSVN = $(sort $(wildcard t91[0-9][0-9]-*.sh)) @@@ -44,7 -44,7 +45,7 @@@ clean-except-prove-cache clean: clean-except-prove-cache $(RM) .prove - test-lint: test-lint-duplicates test-lint-executable + test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax test-lint-duplicates: @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \ @@@ -56,6 -56,9 +57,9 @@@ test-lint-executable test -z "$$bad" || { \ echo >&2 "non-executable tests:" $$bad; exit 1; } + test-lint-shell-syntax: + @'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) + aggregate-results-and-cleanup: $(T) $(MAKE) aggregate-results $(MAKE) clean @@@ -88,7 -91,7 +92,7 @@@ test-results mkdir -p test-results test-results/git-smoke.tar.gz: test-results - $(PERL_PATH) ./harness \ + '$(PERL_PATH_SQ)' ./harness \ --archive="test-results/git-smoke.tar.gz" \ $(T)