On Thursday, October 10, 2002, at 05:04  pm, Tony Bowden wrote:

[snip]
> I hate this sort of duplication, so I tried for a while to eliminate it,
> mostly through an approach like:
>
>       use Test::Class;
>       use UNIVERSAL::require;
>
>   my @tests = qw( Example::Test Another::Test );
>   foreach my $class (@tests) {
>     $class->require or die "Can't require $class";
>   }
>   Test::Class->runtests(@tests);
>
> However this keeps dying with "cannot test anonymous subs". A
> cursory delve into the innards of Test::Class implies that perhaps
> Attribute::Handlers is getting confused somewhere. But I'm not sure
> what's going on here really ...
>
> Anyone shed any light?
[snip]

Can't shed any light yet... However, here's another way of doing what you 
want that does work :-)

     my @TEST_CLASSES;

     BEGIN {
            @TEST_CLASSES = qw(
                    Example::Test
                    Another::Test
            );
            foreach my $class (@TEST_CLASSES) {
                    eval "use $class";
                    die "$@" if $@;
            };
     };

     Test::Class->runtests( @TEST_CLASSES );

Can you pass on the version # of Attribute::Handlers & UNIVERSAL::require 
you're using - since it's failing silently for me, rather than giving the 
error... will investigate further.

Adrian
--
Adrian Howard  <[EMAIL PROTECTED]>
phone: 01929 550720  fax: 0870 131 3033  www.quietstars.com

Reply via email to