[tap-l] Mad TAP proposal
Geoffrey Young
geoff at modperlcookbook.org
Thu Nov 1 11:53:45 EST 2007
Andy Armstrong wrote:
> On 1 Nov 2007, at 15:38, Michael Peters wrote:
>> Isn't this the problem that SKIP was designed to fix? If it needs to
>> dynamically
>> determined if a test should run, isn't the test itself the best place
>> to do
>> that? xt tests shouldn't be run unless explicity done so by the runner
>> of the
>> tests (a developer) who presumably knows that they are doing.
>
> The feature request that started all this relates to a large test suite
> most of which needs to be skipped if a graphical environment isn't
> available - so presumably it'd involve executing hundreds of tests just
> to find out that they skipped.
fwiw, Apache-Test respects an all.t file, which looks something like this:
use Apache::Test;
# skip all tests unless mod_perl and mod_apreq are available
plan tests => 1, need_module('mod_perl.c', 'mod_apreq2.c');
ok 1;
the test is silently executed by our harness. if the plan succeeds and
the test run, A-T will run all tests in the current directory. if the
plan fails, the skip message is printed and all tests in the directory
are never executed.
it sits next to the tests as
t/foo/all.t
t/foo/01do.t
t/foo/02done.t
or whatnot.
anyway, its not the best way to handle things necessarily (I didn't
write it, and it's over 6 years old now :) but it it does come in handy
every once in a while, so the idea in general is probably sound.
--Geoff
More information about the tap-l
mailing list