Skip to content

Commit aae5239

Browse files
navytuxgitster
authored andcommitted
t/Makefile: Use $(sort ...) explicitly where needed
Starting from GNU Make 3.82 $(wildcard ...) no longer sorts the result (from NEWS): * WARNING: Backward-incompatibility! Wildcards were not documented as returning sorted values, but the results have been sorted up until this release.. If your makefiles require sorted results from wildcard expansions, use the $(sort ...) function to request it explicitly. http://repo.or.cz/w/make.git/commitdiff/2a59dc32aaf0681dec569f32a9d7ab88a379d34f I usually watch test progress visually, and if tests are sorted, even with make -j4 they go more or less incrementally by their t number. On the other side, without sorting, tests are executed in seemingly random order even for -j1. Let's please maintain sane tests order for perceived prettyness. Another note is that in GNU Make sort also works as uniq, so after sort being removed, we might expect e.g. $(wildcard *.sh a.*) to produce duplicates for e.g. "a.sh". From this point of view, adding sort could be seen as hardening t/Makefile from accidentally introduced dups. It turned out that prevous releases of GNU Make did not perform full sort in $(wildcard), only sorting results for each pattern, that's why explicit sort-as-uniq is relevant even for older makes. Signed-off-by: Kirill Smelkov <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 406da78 commit aae5239

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@ DEFAULT_TEST_TARGET ?= test
1717
# Shell quote;
1818
SHELL_PATH_SQ = $(subst ','\'',$(SHELL_PATH))
1919

20-
T = $(wildcard t[0-9][0-9][0-9][0-9]-*.sh)
21-
TSVN = $(wildcard t91[0-9][0-9]-*.sh)
22-
TGITWEB = $(wildcard t95[0-9][0-9]-*.sh)
20+
T = $(sort $(wildcard t[0-9][0-9][0-9][0-9]-*.sh))
21+
TSVN = $(sort $(wildcard t91[0-9][0-9]-*.sh))
22+
TGITWEB = $(sort $(wildcard t95[0-9][0-9]-*.sh))
2323

2424
all: $(DEFAULT_TEST_TARGET)
2525

0 commit comments

Comments
 (0)