git@vger.kernel.org list mirror (unofficial, one of many)
 help / color / mirror / code / Atom feed
* [PATCH] Issue #353: Skipping lazy prereq for skipped tests
@ 2020-08-20 16:01 Gopal Yadav
  2020-08-20 18:47 ` René Scharfe
  0 siblings, 1 reply; 2+ messages in thread
From: Gopal Yadav @ 2020-08-20 16:01 UTC (permalink / raw)
  To: git; +Cc: Johannes.Schindelin, sunshine

 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
         say >&3 "checking known breakage of $TEST_NUMBER.$test_count '$1': $2"
         if test_run_ "$2" expecting_failure
         then
@@ -598,10 +598,10 @@ test_expect_success () {
     test "$#" = 3 && { test_prereq=$1; shift; } || test_prereq=
     test "$#" = 2 ||
     BUG "not 2 or 3 parameters to test-expect-success"
-    test_verify_prereq
-    export test_prereq
     if ! test_skip "$@"
     then
+        test_verify_prereq
+        export test_prereq
         say >&3 "expecting success of $TEST_NUMBER.$test_count '$1': $2"
         if test_run_ "$2"
         then
@@ -627,10 +627,10 @@ test_external () {
     BUG "not 3 or 4 parameters to test_external"
     descr="$1"
     shift
-    test_verify_prereq
-    export test_prereq
     if ! test_skip "$descr" "$@"
     then
+        test_verify_prereq
+        export test_prereq
         # Announce the script to reduce confusion about the
         # test output that follows.
         say_color "" "# run $test_count: $descr ($*)"
-- 
2.20.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Issue #353: Skipping lazy prereq for skipped tests
  2020-08-20 16:01 [PATCH] Issue #353: Skipping lazy prereq for skipped tests Gopal Yadav
@ 2020-08-20 18:47 ` René Scharfe
  0 siblings, 0 replies; 2+ messages in thread
From: René Scharfe @ 2020-08-20 18:47 UTC (permalink / raw)
  To: Gopal Yadav, git; +Cc: Johannes.Schindelin, sunshine

Am 20.08.20 um 18:01 schrieb Gopal Yadav:
>  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é

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-20 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-20 16:01 [PATCH] Issue #353: Skipping lazy prereq for skipped tests Gopal Yadav
2020-08-20 18:47 ` René Scharfe

git@vger.kernel.org list mirror (unofficial, one of many)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://public-inbox.org/git
	git clone --mirror http://ou63pmih66umazou.onion/git
	git clone --mirror http://czquwvybam4bgbro.onion/git
	git clone --mirror http://hjrcffqmbrq6wope.onion/git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 git git/ https://public-inbox.org/git \
		git@vger.kernel.org
	public-inbox-index git

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.version-control.git
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.version-control.git
	nntp://ie5yzdi7fg72h7s4sdcztq5evakq23rdt33mfyfcddc5u3ndnw24ogqd.onion/inbox.comp.version-control.git
	nntp://4uok3hntl7oi7b4uf4rtfwefqeexfzil2w6kgk2jn5z2f764irre7byd.onion/inbox.comp.version-control.git
	nntp://news.gmane.io/gmane.comp.version-control.git
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	https://80x24.org/mirrors/git.git

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git