mandog has asked for the wisdom of the Perl Monks concerning the following question:
We've written a simple script to do a simple task, still we'd like to include unit tests...
The problem is that if we don't run in test mode, we still get this message printed to stderr:
# No tests run!Since the code will run from cron, this is a small hassle. The relivant bits are:
use Test::More qw(no_plan); if ( @ARGV == 0 ) { main(); } elsif ( @ARGV == 2 && lc( $ARGV[0] ) eq 'test' ) { Run_Test( $ARGV[1] ); } else { die "bad arguments: the comments may help in $0\n"; }
email: mandog
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: self testing code Test::More
by dws (Chancellor) on Aug 29, 2002 at 05:01 UTC | |
Re: self testing code Test::More
by jmcnamara (Monsignor) on Aug 29, 2002 at 08:17 UTC |
Back to
Seekers of Perl Wisdom