philcrow has asked for the wisdom of the Perl Monks concerning the following question:
During testing I usually start with a single test file, which tries to use all the modules. But, when I do that for this project, I get subroutine redefinition warnings. As you can see below, I tried some variations of no warnings without much luck. Is there a way to suppress these, or do I have to use separate test files?
Here are some of my attempts (all of them led directly to redefined warnings):
use Test::More tests => 2; no warnings; BEGIN { use_ok( 'Backend::A' ); } BEGIN { use_ok( 'Backend::B' ); }
use Test::More tests => 2; no warnings qw( redefine ); BEGIN { use_ok( 'Backend::A' ); } BEGIN { use_ok( 'Backend::B' ); }
use Test::More tests => 2; BEGIN { use_ok( 'Backend::A' ); } BEGIN { no warnings qw( redefine ); use_ok( 'Backend::B' ); }
Phil# having given up on testing temporarily: no warnings qw( redefine ); require Backend::A; require Backend::B;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Suppressing Subroutine redefined warning
by jdporter (Paladin) on Mar 27, 2006 at 20:07 UTC | |
by philcrow (Priest) on Mar 27, 2006 at 20:22 UTC | |
by japhy (Canon) on Mar 27, 2006 at 20:35 UTC | |
by philcrow (Priest) on Mar 27, 2006 at 21:07 UTC | |
|
Re: Suppressing Subroutine redefined warning
by chromatic (Archbishop) on Mar 28, 2006 at 01:49 UTC |