summaryrefslogtreecommitdiff
path: root/t/Makefile
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-01-10 21:47:04 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-01-10 21:47:04 (GMT)
commit4249d850cff0d1d36b3a9c4cf38066c50365cfd1 (patch)
treecdca9f6c091de6d5b462a5880029d52127f82fdb /t/Makefile
parent6a37cee10abe36fbbf635129d5ae114dbf96d395 (diff)
parentc7ce70ace9794a8f0b4774d803536a7ecdf318de (diff)
downloadgit-4249d850cff0d1d36b3a9c4cf38066c50365cfd1.zip
git-4249d850cff0d1d36b3a9c4cf38066c50365cfd1.tar.gz
git-4249d850cff0d1d36b3a9c4cf38066c50365cfd1.tar.bz2
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
Diffstat (limited to 't/Makefile')
-rw-r--r--t/Makefile8
1 files changed, 6 insertions, 2 deletions
diff --git a/t/Makefile b/t/Makefile
index 5c6de81..1923cc1 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -17,6 +17,7 @@ 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 +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 +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 +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)