]> git.ipfire.org Git - thirdparty/git.git/commit - t/test-lib.sh
test-lib: don't check prereqs of test cases that won't be run anyway
authorSZEDER Gábor <szeder.dev@gmail.com>
Tue, 12 Nov 2019 12:24:38 +0000 (13:24 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Nov 2019 02:06:54 +0000 (11:06 +0900)
commite0316695ec323d2dde837e32ba16a82a36d828b4
tree26e1cbdf4ace78bd50269a2cc2ef637257e12b47
parent5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9
test-lib: don't check prereqs of test cases that won't be run anyway

With './t1234-foo.sh -r 5,6' we can run only specific test cases in a
test script, but our test framwork still evaluates all lazy prereqs
that the excluded test cases might depend on.  This is unnecessary and
produces verbose and trace output that can be distracting.  This has
been an issue ever since the '-r|--run=' options were introduced in
0445e6f0a1 (test-lib: '--run' to run only specific tests, 2014-04-30),
because that commit added the check of the list of test cases
specified with '-r' after evaluating the prereqs.

Avoid this unnecessary prereq evaluation by checking the list of test
cases specified with '-r' before looking at the prereqs.

Note that GIT_SKIP_TESTS has always been checked before the prereqs,
so prereqs necessary for tests skipped that way were not evaluated.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/test-lib.sh