Merge branch 'js/test-lint-pathname'

The "t/" hierarchy is prone to get an unusual pathname; "make test"
has been taught to make sure they do not contain paths that cannot
be checked out on Windows (and the mechanism can be reusable to
catch pathnames that are not portable to other platforms as need
arises).

* js/test-lint-pathname:
  t/Makefile: ensure that paths are valid on platforms we care
This commit is contained in:
Junio C Hamano 2016-08-17 14:07:48 -07:00
Родитель 3f5ad0a090 c2cafd39bc
Коммит 187c80ba93
1 изменённых файлов: 10 добавлений и 1 удалений

Просмотреть файл

@ -52,7 +52,8 @@ clean-except-prove-cache:
clean: clean-except-prove-cache clean: clean-except-prove-cache
$(RM) .prove $(RM) .prove
test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
test-lint-filenames
test-lint-duplicates: test-lint-duplicates:
@dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \ @dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
@ -67,6 +68,14 @@ test-lint-executable:
test-lint-shell-syntax: test-lint-shell-syntax:
@'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS) @'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS)
test-lint-filenames:
@# We do *not* pass a glob to ls-files but use grep instead, to catch
@# non-ASCII characters (which are quoted within double-quotes)
@bad="$$(git -c core.quotepath=true ls-files 2>/dev/null | \
grep '["*:<>?\\|]')"; \
test -z "$$bad" || { \
echo >&2 "non-portable file name(s): $$bad"; exit 1; }
aggregate-results-and-cleanup: $(T) aggregate-results-and-cleanup: $(T)
$(MAKE) aggregate-results $(MAKE) aggregate-results
$(MAKE) clean $(MAKE) clean