httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject Re: Skipped tests marked as failed?
Date Sat, 10 Nov 2001 04:47:06 GMT
Rodent of Unusual Size wrote:

> Doug MacEachern wrote:
> 
>>On Fri, 9 Nov 2001, Rodent of Unusual Size wrote:
>>
>>
>>>I thought skipped subtests were supposed to be treated as
>>>qualified successes?  And Doug, didn't you say the output
>>>displayed by the skip sub would say 'skipped'?
>>>
>>looks like you've fixed the problem?
>>
> 
> Not I.  I'm still seeing skipped tests saying 'ok' (not 'skipped')
> but now they're getting counted as 'ok'. 


That's correct. The sub-tests can be only ok/nok, and skipped is 
designated as: ok 3 # skip reason

> So I guess it's a
> non-problem (or at least cosmetic only) now.  Dunno what happened.

I guess I was wrong when I've suggested to add another arg, after skip 
reason. I read this syntax in the Test::More module, which is not the 
same as Test. sorry about that. May be you have an older Perl and that's 
why saying 'skip $reason' doesn't work for you?

After re-reading the manpages, I this should be the boiler plate for 
skipping tests.

my $skip_reason = "missing foo";
if ($skip_reason) {
     skip $skip_reason;
}
else {
     # do something
     ok 1;
}

Test.pm doesn't support skipping a group of tests, so if you want to do 
it for a group you may end up with something like this:

my $skip_reason = "missing foo";
if ($skip_reason) {
     for (1..3)  {
         skip $skip_reason;
     }
}
else {
     # do something
     ok 1;
     ok 1;
     ok 1;
}

I guess if this looks ugly we can override Test::skip with 
Apache::Test::skip and allow:

   skip $reason, $num_of_sub_tests_to_skip;

and then the code will look like:

my $skip_reason = "missing foo";
if ($skip_reason) {
     skip $skip_reason, 3;
}
else {
     # do something
     ok 1;
     ok 1;
     ok 1;
}

let us know if that's needed.

_____________________________________________________________________
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/


Mime
View raw message