Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Simple CPAN distribution.

Report information
The Basics
Id: 29481
Status: rejected
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: schwern [...] pobox.com
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: (no value)
Fixed in: (no value)



Subject: skip_rest
Date: Tue, 18 Sep 2007 19:48:26 -0700
To: bugs-Test-Simple [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Show quoted text
-------- Original Message -------- Subject: skip_rest Date: Sun, 2 Sep 2007 23:40:44 +0100 From: Chia-Liang Kao <clkao@clkao.org> To: mschwern@cpan.org please implement skip_rest in Test::More there's code in both jifty::test::www::selenium and jifty::testserver doing so: # dirty hack until Test::Builder->skip_rest comes true my $why = "live test doesn't work on Win32 at the moment"; $Tester->skip($why); unless ($Tester->{No_Plan}) { for (my $ct = $Tester->{Curr_Test}; $ct < $Tester->{Expected_Tests}; $ct++ ) { $Tester->skip($why); # skip rest of the test } } exit(0); -- Hating the web since 1994.
I've warmed to adding this because it makes the skip_all check simpler. Instead of... use Test::More; if( $^O eq 'BrokenOS' ) { plan skip_all => 'Your shit is broke'; } else { plan tests => 42; } You can do the more straightforward: use Test::More tests => 42; skip_rest("Your shit is broke") if $^O eq 'BrokenOS';
On Tue Dec 04 17:04:07 2007, MSCHWERN wrote: Show quoted text
> I've warmed to adding this because it makes the skip_all check simpler. > Instead of... > > use Test::More; > > if( $^O eq 'BrokenOS' ) { > plan skip_all => 'Your shit is broke'; > } > else { > plan tests => 42; > } > > You can do the more straightforward: > > use Test::More tests => 42; > > skip_rest("Your shit is broke") if $^O eq 'BrokenOS';
bail-out, die-on-fail, and bail-on-fail are better solutions for some of these options. There are other Test2 plugins to help you skip all if conditions are not what you want. Test2::Require:: modules.