Make 'verbose' option default to 0 in testmode.

This commit is contained in:
Adam Spiers 2011-11-18 11:14:50 +00:00
parent 80826b96e2
commit 3418cadb8e

View file

@ -264,12 +264,13 @@ sub process_options {
sub debug { sub debug {
my ($level, $msg) = @_; my ($level, $msg) = @_;
if ($Option{'testmode'}) { if ($Option{'testmode'}) {
# Convert TEST_VERBOSE=y into numeric value
$ENV{TEST_VERBOSE} = 3 $ENV{TEST_VERBOSE} = 3
if $ENV{TEST_VERBOSE} && $ENV{TEST_VERBOSE} !~ /^\d+$/; if $ENV{TEST_VERBOSE} && $ENV{TEST_VERBOSE} !~ /^\d+$/;
$Option{'verbose'} = $ENV{TEST_VERBOSE}
if $ENV{TEST_VERBOSE} && ! $Option{'verbose'}; my $verbose = exists $Option{'verbose'} ? $Option{'verbose'} :
print "# $msg\n" length $ENV{TEST_VERBOSE} ? $ENV{TEST_VERBOSE} : 0;
if $Option{'verbose'} >= $level; print "# $msg\n" if $verbose >= $level;
} }
elsif ($Option{'verbose'} >= $level) { elsif ($Option{'verbose'} >= $level) {
warn "$msg\n"; warn "$msg\n";