Re: [PATCH v2 1/3] test-lib: allow selecting tests by substring/regex with --run
- From
Jeff King <peff@peff.net>
- Date
- Oct 14, 2020, 17:04 UTC
- Message-ID
- <20201014170413.GB21687@coredump.intra.peff.net>
- In-Reply-To
- <41e2528e83ba7087c9d21f0b15efed416f1512f8.1602616786.git.gitgitgadget@gmail.com>
On Tue, Oct 13, 2020 at 07:19:44PM +0000, Elijah Newren via GitGitGadget wrote:
> Many of our test scripts have several "setup" tests. It's a lot easier > to say > > ./t0050-filesystem.sh --run=setup,9
I like this direction very well.
There was a small discussion recently that we might be better off dropping test script numbers entirely, and allowing selection of script names by word-hierarchy or regex, too. That's mostly orthogonal to what you're doing here, but I think this is taking us in a good direction there.
Show 10 quoted lines
> @@ -819,9 +821,8 @@ match_test_selector_list () {
> *)
> if expr "z$selector" : "z[0-9]*[^0-9]" >/dev/null
> then
> - echo "error: $title: invalid non-numeric in test" \
> - "selector: '$orig_selector'" >&2
> - exit 1
> + echo "$title" | grep -q "$selector" && return
> + continue
> fiI like that you allow regexes. It's unfortunate that the skip-check costs us a process in every test. It may not be that big a deal since we only pay it if you use a non-numeric selector. But I wonder if there's any reason not to use "expr" here, as well.
-Peff