Skip to content

Commit 86df11b

Browse files
committed
Merge branch 'js/test-lint-pathname' into maint
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
2 parents 8e7c580 + c2cafd3 commit 86df11b

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

t/Makefile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ clean-except-prove-cache:
5252
clean: clean-except-prove-cache
5353
$(RM) .prove
5454

55-
test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax
55+
test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
56+
test-lint-filenames
5657

5758
test-lint-duplicates:
5859
@dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
@@ -67,6 +68,14 @@ test-lint-executable:
6768
test-lint-shell-syntax:
6869
@'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS)
6970

71+
test-lint-filenames:
72+
@# We do *not* pass a glob to ls-files but use grep instead, to catch
73+
@# non-ASCII characters (which are quoted within double-quotes)
74+
@bad="$$(git -c core.quotepath=true ls-files 2>/dev/null | \
75+
grep '["*:<>?\\|]')"; \
76+
test -z "$$bad" || { \
77+
echo >&2 "non-portable file name(s): $$bad"; exit 1; }
78+
7079
aggregate-results-and-cleanup: $(T)
7180
$(MAKE) aggregate-results
7281
$(MAKE) clean

0 commit comments

Comments
 (0)