Re: [PATCH] Issue #353: Skipping lazy prereq for skipped tests
- From
René Scharfe <l.s.r@web.de>
- Date
- Aug 20, 2020, 18:47 UTC
- Message-ID
- <c3ab29b6-39e8-b0a2-d628-873261850b98@web.de>
- In-Reply-To
- <CAAUOv8gf7e=pFGgPBK5cb1_RusWEY7s+iWf95_ETTz_3juzggg@mail.gmail.com>
Am 20.08.20 um 18:01 schrieb Gopal Yadav:
Show 23 quoted lines
> Skipping lazy prereq for test cases that are skipped via
> the --run option or via GIT_SKIP_TESTS. Issue 353:
> https://github.com/gitgitgadget/git/issues/353
>
> Signed-off-by: Gopal Yadav <gopunop@gmail.com>
> ---
> t/test-lib-functions.sh | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh
> index 6a8e194a99..bac86ffd9d 100644
> --- a/t/test-lib-functions.sh
> +++ b/t/test-lib-functions.sh
> @@ -578,10 +578,10 @@ test_expect_failure () {
> test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq=
> test "$#" = 2 ||
> BUG "not 2 or 3 parameters to test-expect-failure"
> - test_verify_prereq
> - export test_prereq
> if ! test_skip "$@"
> then
> + test_verify_prereq
> + export test_prereq$test_prereq is used as a named parameter of the function test_skip, which uses it to determine if a test needs to be skipped due to missing prerequisites. Checking and exporting its input parameter only after it succeeded probably won't do any good.
Anyway, didn't e0316695ec3 (test-lib: don't check prereqs of test cases that won't be run anyway, 2019-11-12) already solve the issue?
René