diff options
author | Aleksey Midenkov <midenok@gmail.com> | 2022-07-18 23:16:17 +0300 |
---|---|---|
committer | Aleksey Midenkov <midenok@gmail.com> | 2022-07-18 23:16:17 +0300 |
commit | ce7820eb838c8413fb0fe1d3812c43824b508eab (patch) | |
tree | f4510a1b1e186977448b6767b7ceec1e544f4972 /mysql-test/lib | |
parent | 83f7d25c440ab7c4279c0716a5dea41de8238b75 (diff) | |
download | mariadb-git-ce7820eb838c8413fb0fe1d3812c43824b508eab.tar.gz |
MDEV-28931 --verbose option is too verbose
GetOpt::Long bundling option for convenient one-char verbosity levels:
-v General verbosity (file and execute operations)
-vv High verbosity (algorithmic considerations)
-vvv Debug verbosity (anything else)
Diffstat (limited to 'mysql-test/lib')
-rw-r--r-- | mysql-test/lib/mtr_cases.pm | 16 | ||||
-rw-r--r-- | mysql-test/lib/mtr_process.pl | 10 | ||||
-rw-r--r-- | mysql-test/lib/mtr_report.pm | 11 | ||||
-rw-r--r-- | mysql-test/lib/v1/mtr_cases.pl | 18 | ||||
-rw-r--r-- | mysql-test/lib/v1/mtr_timer.pl | 6 |
5 files changed, 35 insertions, 26 deletions
diff --git a/mysql-test/lib/mtr_cases.pm b/mysql-test/lib/mtr_cases.pm index dc385cb6c78..b252840555d 100644 --- a/mysql-test/lib/mtr_cases.pm +++ b/mysql-test/lib/mtr_cases.pm @@ -87,7 +87,7 @@ sub init_pattern { # separator betwen suite and testname), make the pattern match # beginning of string $from= "^$from"; - mtr_verbose("$what='$from'"); + mtr_verbose2("$what='$from'"); } # Check that pattern is a valid regex eval { "" =~/$from/; 1 } or @@ -292,7 +292,7 @@ sub combinations_from_file($$) } else { return () if @::opt_combinations or not -f $filename; # Read combinations file in my.cnf format - mtr_verbose("Read combinations file $filename"); + mtr_verbose2("Read combinations file $filename"); my $config= My::Config->new($filename); foreach my $group ($config->option_groups()) { my $comb= { name => $group->name(), comb_opt => [] }; @@ -426,9 +426,9 @@ sub collect_suite_name($$) sub collect_one_suite { my ($opt_cases, $suitename, $over, $suitedir, @overlays) = @_; - mtr_verbose("Collecting: $suitename"); - mtr_verbose("suitedir: $suitedir"); - mtr_verbose("overlays: @overlays") if @overlays; + mtr_verbose2("Collecting: $suitename"); + mtr_verbose2("suitedir: $suitedir"); + mtr_verbose2("overlays: @overlays") if @overlays; # we always need to process the parent suite, even if we won't use any # test from it. @@ -500,8 +500,8 @@ sub process_suite { $suite->{rdir} = -d $rdir ? $rdir : $suite->{tdir}; } - mtr_verbose("testdir: " . $suite->{tdir}); - mtr_verbose( "resdir: " . $suite->{rdir}); + mtr_verbose2("testdir: " . $suite->{tdir}); + mtr_verbose2( "resdir: " . $suite->{rdir}); # disabled.def parse_disabled($suite->{dir} .'/disabled.def', $suitename); @@ -511,7 +511,7 @@ sub process_suite { if (@::opt_combinations) { # take the combination from command-line - mtr_verbose("Take the combination from command line"); + mtr_verbose2("Take the combination from command line"); foreach my $combination (@::opt_combinations) { my $comb= {}; $comb->{name}= $combination; diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index 2ff78c0e10a..681ac4ca201 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -46,7 +46,7 @@ sub mtr_ping_port ($); sub mtr_ping_port ($) { my $port= shift; - mtr_verbose("mtr_ping_port: $port"); + mtr_verbose2("mtr_ping_port: $port"); if (IS_WINDOWS && USE_NETPING) { @@ -56,12 +56,12 @@ sub mtr_ping_port ($) { $ping->port_number($port); if ($ping->ping("localhost",0.1)) { - mtr_verbose("USED"); + mtr_verbose2("USED"); return 1; } else { - mtr_verbose("FREE"); + mtr_verbose2("FREE"); return 0; } } @@ -84,12 +84,12 @@ sub mtr_ping_port ($) { if ( connect(SOCK, $paddr) ) { close(SOCK); # FIXME check error? - mtr_verbose("USED"); + mtr_verbose2("USED"); return 1; } else { - mtr_verbose("FREE"); + mtr_verbose2("FREE"); return 0; } } diff --git a/mysql-test/lib/mtr_report.pm b/mysql-test/lib/mtr_report.pm index 8144a6ef02e..2a8ed65eb2c 100644 --- a/mysql-test/lib/mtr_report.pm +++ b/mysql-test/lib/mtr_report.pm @@ -27,7 +27,7 @@ use Sys::Hostname; use base qw(Exporter); our @EXPORT= qw(report_option mtr_print_line mtr_print_thick_line mtr_print_header mtr_report mtr_report_stats - mtr_warning mtr_error mtr_debug mtr_verbose + mtr_warning mtr_error mtr_debug mtr_verbose mtr_verbose2 mtr_verbose_restart mtr_report_test_passed mtr_report_test_skipped mtr_print mtr_report_test isotime); @@ -716,6 +716,15 @@ sub mtr_verbose (@) { } +sub mtr_verbose2 (@) { + if ( $verbose > 1 ) + { + print STDERR _name(). _timestamp(). + "> ".join(" ", @_)."\n"; + } +} + + sub mtr_verbose_restart (@) { my ($server, @args)= @_; my $proc= $server->{proc}; diff --git a/mysql-test/lib/v1/mtr_cases.pl b/mysql-test/lib/v1/mtr_cases.pl index faa673a9304..cc190cb39f7 100644 --- a/mysql-test/lib/v1/mtr_cases.pl +++ b/mysql-test/lib/v1/mtr_cases.pl @@ -126,19 +126,19 @@ sub collect_test_cases ($) { { my $base_name= $1; my $idx= $2; - mtr_verbose("$test_name => $base_name idx=$idx"); + mtr_verbose2("$test_name => $base_name idx=$idx"); if ( $idx > 1 ) { $idx-= 1; $base_name= "$base_name$idx"; - mtr_verbose("New basename $base_name"); + mtr_verbose2("New basename $base_name"); } foreach my $tinfo2 (@$cases) { if ( $tinfo2->{'name'} eq $base_name ) { - mtr_verbose("found dependent test $tinfo2->{'name'}"); + mtr_verbose2("found dependent test $tinfo2->{'name'}"); $depend_on_test_name=$base_name; } } @@ -146,7 +146,7 @@ sub collect_test_cases ($) { if ( defined $depend_on_test_name ) { - mtr_verbose("Giving $test_name same critera as $depend_on_test_name"); + mtr_verbose2("Giving $test_name same critera as $depend_on_test_name"); $sort_criteria{$test_name} = $sort_criteria{$depend_on_test_name}; } else @@ -224,14 +224,14 @@ sub collect_one_suite($) my $suite= shift; # Test suite name my @cases; # Array of hash - mtr_verbose("Collecting: $suite"); + mtr_verbose2("Collecting: $suite"); my $suitedir= "$::glob_mysql_test_dir"; # Default if ( $suite ne "main" ) { $suitedir= mtr_path_exists("$suitedir/suite/$suite", "$suitedir/$suite"); - mtr_verbose("suitedir: $suitedir"); + mtr_verbose2("suitedir: $suitedir"); } my $testdir= "$suitedir/t"; @@ -363,7 +363,7 @@ sub collect_one_suite($) if (@::opt_combinations) { # take the combination from command-line - mtr_verbose("Take the combination from command line"); + mtr_verbose2("Take the combination from command line"); foreach my $combination (@::opt_combinations) { my $comb= {}; $comb->{name}= $combination; @@ -374,7 +374,7 @@ sub collect_one_suite($) elsif (-f $combination_file ) { # Read combinations file in my.cnf format - mtr_verbose("Read combinations file"); + mtr_verbose2("Read combinations file"); my $config= My::Config->new($combination_file); foreach my $group ($config->groups()) { @@ -605,7 +605,7 @@ sub collect_one_test_case($$$$$$$$$) { # Add suite opts foreach my $opt ( @$suite_opts ) { - mtr_verbose($opt); + mtr_verbose2($opt); push(@{$tinfo->{'master_opt'}}, $opt); push(@{$tinfo->{'slave_opt'}}, $opt); } diff --git a/mysql-test/lib/v1/mtr_timer.pl b/mysql-test/lib/v1/mtr_timer.pl index 630a93ca7dc..98dc27b3f0f 100644 --- a/mysql-test/lib/v1/mtr_timer.pl +++ b/mysql-test/lib/v1/mtr_timer.pl @@ -80,7 +80,7 @@ sub mtr_timer_start($$$) { if ( $tpid ) { # Parent, record the information - mtr_verbose("Starting timer for '$name',", + mtr_verbose2("Starting timer for '$name',", "duration: $duration, pid: $tpid"); $timers->{'timers'}->{$name}->{'pid'}= $tpid; $timers->{'timers'}->{$name}->{'duration'}= $duration; @@ -96,13 +96,13 @@ sub mtr_timer_start($$$) { $SIG{INT}= 'DEFAULT'; $SIG{TERM}= sub { - mtr_verbose("timer $$ woke up, exiting!"); + mtr_verbose2("timer $$ woke up, exiting!"); exit(0); }; $0= "mtr_timer(timers,$name,$duration)"; sleep($duration); - mtr_verbose("timer $$ expired after $duration seconds"); + mtr_verbose2("timer $$ expired after $duration seconds"); exit(0); } } |