Skip to content

Commit d28c5a5

Browse files
steadmongitster
authored andcommitted
test-tool run-command testsuite: remove hardcoded filter
`test-tool run-command testsuite` currently assumes that it will only be running the shell test suite, and therefore filters out anything that does not match a hardcoded pattern of "t[0-9][0-9][0-9][0-9]-*.sh". Later in this series, we'll adapt `test-tool run-command testsuite` to also support unit tests, which do not follow the same naming conventions as the shell tests, so this hardcoded pattern is inconvenient. Since `testsuite` also allows specifying patterns on the command-line, let's just remove this pattern. As noted in [1], there are no longer any uses of `testsuite` in our codebase, it should be OK to break backwards compatibility in this case. We also add a new filter to avoid trying to execute "." and "..", so that users who wish to execute every test in a directory can do so without specifying a pattern. [1] https://lore.kernel.org/git/[email protected]/ Signed-off-by: Josh Steadmon <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 22f0df7 commit d28c5a5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

t/helper/test-run-command.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -175,9 +175,7 @@ static int testsuite(int argc, const char **argv)
175175
while ((d = readdir(dir))) {
176176
const char *p = d->d_name;
177177

178-
if (*p != 't' || !isdigit(p[1]) || !isdigit(p[2]) ||
179-
!isdigit(p[3]) || !isdigit(p[4]) || p[5] != '-' ||
180-
!ends_with(p, ".sh"))
178+
if (!strcmp(p, ".") || !strcmp(p, ".."))
181179
continue;
182180

183181
/* No pattern: match all */

0 commit comments

Comments
 (0)