git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] test-lib: TAP compliance for skipping tests on request
@ 2010-07-09 11:15 Michael J Gruber
  2010-07-09 19:36 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 5+ messages in thread
From: Michael J Gruber @ 2010-07-09 11:15 UTC (permalink / raw)
  To: git; +Cc: Ævar Arnfjörð Bjarmason, Junio C Hamano

Make the output TAP compliant for tests skipped on request (GI_SKIP_TESTS).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
We may want to better spell out the reasons, but I think
it's good enough like this for *explicitly* skipped tests.

 t/test-lib.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index 8e3de53..2076271 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -395,7 +395,7 @@ test_skip () {
 	case "$to_skip" in
 	t)
 		say_color skip >&3 "skipping test: $@"
-		say_color skip "ok $test_count: # skip $1"
+		say_color skip "ok $test_count # SKIP $1"
 		: true
 		;;
 	*)
@@ -838,7 +838,7 @@ done
 case "$to_skip" in
 t)
 	say_color skip >&3 "skipping test $this_test altogether"
-	say_color skip "skip all tests in $this_test"
+	skip_all="skip all tests in $this_test"
 	test_done
 esac
 
-- 
1.7.2.rc1.212.g850a

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

* Re: [PATCH] test-lib: TAP compliance for skipping tests on request
  2010-07-09 11:15 [PATCH] test-lib: TAP compliance for skipping tests on request Michael J Gruber
@ 2010-07-09 19:36 ` Ævar Arnfjörð Bjarmason
  2010-07-12 10:33   ` [PATCHv2] " Michael J Gruber
  0 siblings, 1 reply; 5+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-07-09 19:36 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git, Junio C Hamano

On Fri, Jul 9, 2010 at 11:15, Michael J Gruber <git@drmicha.warpmail.net> wrote:
> Make the output TAP compliant for tests skipped on request (GI_SKIP_TESTS).

That "GI_SKIP_TESTS" has a T-deficit.

> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
> We may want to better spell out the reasons, but I think
> it's good enough like this for *explicitly* skipped tests.
>
>  t/test-lib.sh |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/t/test-lib.sh b/t/test-lib.sh
> index 8e3de53..2076271 100644
> --- a/t/test-lib.sh
> +++ b/t/test-lib.sh
> @@ -395,7 +395,7 @@ test_skip () {
>        case "$to_skip" in
>        t)
>                say_color skip >&3 "skipping test: $@"
> -               say_color skip "ok $test_count: # skip $1"
> +               say_color skip "ok $test_count # SKIP $1"

Good catch with the s/://, but I think the lower-case "skip" should
stay that way. At least that's what Test::More does:

    $ perl -MTest::More=tests,2 -E 'SKIP: { skip "no can do", 1 } pass "can do"'
    1..2
    ok 1 # skip no can do
    ok 2 - can do

It only uses upper-case on skip-all. I.e. when part of the plan line:

    $ perl -MTest::More=skip_all,"this platform sucks" -e1
    1..0 # SKIP this platform sucks

Maybe I've missed something, or Test::More has a bug.

>                : true
>                ;;
>        *)
> @@ -838,7 +838,7 @@ done
>  case "$to_skip" in
>  t)
>        say_color skip >&3 "skipping test $this_test altogether"
> -       say_color skip "skip all tests in $this_test"
> +       skip_all="skip all tests in $this_test"
>        test_done
>  esac

Good catch. I missed that (again) in my "tests: Use skip_all=<reason>
to skip tests" patch.

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

* [PATCHv2] test-lib: TAP compliance for skipping tests on request
  2010-07-09 19:36 ` Ævar Arnfjörð Bjarmason
@ 2010-07-12 10:33   ` Michael J Gruber
  2010-07-12 11:07     ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 5+ messages in thread
From: Michael J Gruber @ 2010-07-12 10:33 UTC (permalink / raw)
  To: git; +Cc: Junio C Hamano, Ævar Arnfjörð Bjarmason

Make the output TAP compliant for tests skipped on request (GIT_SKIP_TESTS).

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
---
v2 has a typo fix in the commit message and the spelling of "skip"
as suggested by AAB.

I think I've read it differently in the RFC, but then I was also confused about
the "#" in the RFC, and following the "reference" implementation (as per AAB)
should be the best approach.

 t/test-lib.sh |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/t/test-lib.sh b/t/test-lib.sh
index bc06564..db8371c 100644
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -396,7 +396,7 @@ test_skip () {
 	case "$to_skip" in
 	t)
 		say_color skip >&3 "skipping test: $@"
-		say_color skip "ok $test_count: # skip $1"
+		say_color skip "ok $test_count # skip $1"
 		: true
 		;;
 	*)
@@ -833,7 +833,7 @@ do
 	case "$this_test" in
 	$skp)
 		say_color skip >&3 "skipping test $this_test altogether"
-		say_color skip "skip all tests in $this_test"
+		skip_all="skip all tests in $this_test"
 		test_done
 	esac
 done
-- 
1.7.2.rc1.212.g850a

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

* Re: [PATCHv2] test-lib: TAP compliance for skipping tests on request
  2010-07-12 10:33   ` [PATCHv2] " Michael J Gruber
@ 2010-07-12 11:07     ` Ævar Arnfjörð Bjarmason
  2010-07-12 16:44       ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2010-07-12 11:07 UTC (permalink / raw)
  To: Michael J Gruber; +Cc: git, Junio C Hamano

On Mon, Jul 12, 2010 at 10:33, Michael J Gruber
<git@drmicha.warpmail.net> wrote:
> Make the output TAP compliant for tests skipped on request (GIT_SKIP_TESTS).
>
> Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
> ---
> v2 has a typo fix in the commit message and the spelling of "skip"
> as suggested by AAB.
>
> I think I've read it differently in the RFC, but then I was also confused about
> the "#" in the RFC, and following the "reference" implementation (as per AAB)
> should be the best approach.

Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>

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

* Re: [PATCHv2] test-lib: TAP compliance for skipping tests on request
  2010-07-12 11:07     ` Ævar Arnfjörð Bjarmason
@ 2010-07-12 16:44       ` Junio C Hamano
  0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2010-07-12 16:44 UTC (permalink / raw)
  To: Ævar Arnfjörð Bjarmason; +Cc: Michael J Gruber, git

Thanks, both.

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

end of thread, other threads:[~2010-07-12 16:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-09 11:15 [PATCH] test-lib: TAP compliance for skipping tests on request Michael J Gruber
2010-07-09 19:36 ` Ævar Arnfjörð Bjarmason
2010-07-12 10:33   ` [PATCHv2] " Michael J Gruber
2010-07-12 11:07     ` Ævar Arnfjörð Bjarmason
2010-07-12 16:44       ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).