diff options
author | Josh Steadmon <steadmon@google.com> | 2024-05-06 12:57:33 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-06 14:06:34 -0700 |
commit | d28c5a520fd72f792540229a29e8f875a97e422a (patch) | |
tree | b6b9278264a9c666e0b60dd75b6626849a7f7a4f | |
parent | 22f0df7a093182eeaf5e6da957d20ae8b858679f (diff) | |
download | git-d28c5a520fd72f792540229a29e8f875a97e422a.tar.gz |
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/850ea42c-f103-68d5-896b-9120e2628686@gmx.de/
Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | t/helper/test-run-command.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/t/helper/test-run-command.c b/t/helper/test-run-command.c index a41a54d9cb..e6bd792274 100644 --- a/t/helper/test-run-command.c +++ b/t/helper/test-run-command.c @@ -175,9 +175,7 @@ static int testsuite(int argc, const char **argv) while ((d = readdir(dir))) { const char *p = d->d_name; - if (*p != 't' || !isdigit(p[1]) || !isdigit(p[2]) || - !isdigit(p[3]) || !isdigit(p[4]) || p[5] != '-' || - !ends_with(p, ".sh")) + if (!strcmp(p, ".") || !strcmp(p, "..")) continue; /* No pattern: match all */ |