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 Gary Benson <gb...@redhat.com> on 2001/08/09 16:18:45 UTC

Skipped tests

In httpd-test's perl-framework tests, Apache::Test::plan is a wrapper
around Test::plan. Apache::Test::plan allows you to have a condition as
the last argument of the plan call; if the condition is not met, the test
is skipped. A test which will only be run if we have php4 looks like this:

| plan tests => 1, \&ExtModules::TestEnv::has_php4;
|
| my $result = GET_BODY "/php/add.php";
| ok $result eq '6';

Test also has the facility to define tests which can be conditionally
skipped. Here you say:

| plan tests => 1
|
| skip !&ExtModules::TestEnv::has_php4, GET_BODY("/php/add.php") eq '6';

[the first argument to Test::skip being skip_this_test]

Why, then, the duplication of functionality in Apache::Test? Is it just an
oversight, or is there something else going on that I haven't realised?

Gary

[ Gary Benson, Red Hat Europe ][ gbenson@redhat.com ][ GnuPG 60E8793A ]


Re: Skipped tests

Posted by Gary Benson <gb...@redhat.com>.
On Thu, 9 Aug 2001, Doug MacEachern wrote:

> On Thu, 9 Aug 2001, Gary Benson wrote:
>
> > | skip !&ExtModules::TestEnv::has_php4, GET_BODY("/php/add.php") eq '6';
>
> that only skips one test in a test file, so if you plan 60 php tests in a
> single file, you have to test that condition 60 times.  not good.
> Apache::Test::plan lets you skip every test in a file in one shot.

Fair enough.


Re: Skipped tests

Posted by Doug MacEachern <do...@covalent.net>.
On Thu, 9 Aug 2001, Gary Benson wrote:

> | skip !&ExtModules::TestEnv::has_php4, GET_BODY("/php/add.php") eq '6';

that only skips one test in a test file, so if you plan 60 php tests in a
single file, you have to test that condition 60 times.  not good.
Apache::Test::plan lets you skip every test in a file in one shot.