You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Rodent of Unusual Size <Ke...@Golux.Com> on 2001/11/06 22:41:16 UTC

Skipping subtests?

Is there a way to indicate that specific subtests should be
skipped?  I could not do them and adjust the planned tests
accordingly, but I'd rather be able to notify the person
running the tests that some of them can't be run and why.
(Case in point: can't do upload chunking with LWP < 5.60.)
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Re: Skipping subtests?

Posted by Stas Bekman <st...@stason.org>.
Rodent of Unusual Size wrote:

> Doug MacEachern wrote:
> 
>>    skip 'no foo';
>>
>>prints:
>>1..2
>>ok 1
>>ok 2 # skip no foo
>>
> 
> Not for me it doesn't; it prints 'Not enough arguments for Test::skip'.

I think that should be:

  if ($condition) {
    ok ...
    ok...
  }
  else
    skip $reason, $how_many_to_skip; # e.g. 2
  }

that's according to Test::Harness manpage. May be you have different 
versions?

_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:stas@stason.org  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/


Re: Skipping subtests?

Posted by Rodent of Unusual Size <Ke...@Golux.Com>.
Doug MacEachern wrote:
> 
>     skip 'no foo';
> 
> prints:
> 1..2
> ok 1
> ok 2 # skip no foo

Not for me it doesn't; it prints 'Not enough arguments for Test::skip'.
-- 
#ken	P-)}

Ken Coar, Sanagendamgagwedweinini  http://Golux.Com/coar/
Author, developer, opinionist      http://Apache-Server.Com/

"All right everyone!  Step away from the glowing hamburger!"

Re: Skipping subtests?

Posted by Doug MacEachern <do...@covalent.net>.
On Tue, 6 Nov 2001, Rodent of Unusual Size wrote:

> Is there a way to indicate that specific subtests should be
> skipped?  I could not do them and adjust the planned tests
> accordingly, but I'd rather be able to notify the person
> running the tests that some of them can't be run and why.
> (Case in point: can't do upload chunking with LWP < 5.60.)

use Apache::Test;

plan tests => 2;

ok 1;

if ($foo) {
    ok $foo;
}
else {
    skip 'no foo';
}

prints:
1..2
ok 1
ok 2 # skip no foo