Commit 36a67e36 authored by unknown's avatar unknown

Add printouts


mysql-test/lib/mtr_report.pm:
  Add 'mtr_print'
parent 039b1135
...@@ -26,7 +26,7 @@ our @EXPORT= qw(report_option mtr_print_line mtr_print_thick_line ...@@ -26,7 +26,7 @@ our @EXPORT= qw(report_option mtr_print_line mtr_print_thick_line
mtr_print_header mtr_report mtr_report_stats 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_verbose_restart mtr_report_test_passed mtr_verbose_restart mtr_report_test_passed
mtr_report_test_skipped mtr_report_test_skipped mtr_print
mtr_report_test); mtr_report_test);
use mtr_match; use mtr_match;
...@@ -386,8 +386,13 @@ sub _timestamp { ...@@ -386,8 +386,13 @@ sub _timestamp {
$tm->hour, $tm->min, $tm->sec, $diff); $tm->hour, $tm->min, $tm->sec, $diff);
} }
# Always print message to screen
sub mtr_print (@) {
print $name, join(" ", @_), "\n";
}
# Print message to screen # Print message to screen if verbose is defined
sub mtr_report (@) { sub mtr_report (@) {
if (defined $verbose) if (defined $verbose)
{ {
......
...@@ -2895,7 +2895,6 @@ sub run_testcase ($) { ...@@ -2895,7 +2895,6 @@ sub run_testcase ($) {
if ($check_res == 1) { if ($check_res == 1) {
# Test case had sideeffects, not fatal error, just continue # Test case had sideeffects, not fatal error, just continue
stop_all_servers(); stop_all_servers();
clean_datadir();
mtr_report("Resuming tests...\n"); mtr_report("Resuming tests...\n");
} }
else { else {
...@@ -3164,7 +3163,7 @@ sub check_expected_crash_and_restart { ...@@ -3164,7 +3163,7 @@ sub check_expected_crash_and_restart {
# Remove all files and subdirectories of a directory # Remove all files and subdirectories of a directory
sub clean_dir { sub clean_dir {
my ($dir)= @_; my ($dir)= @_;
print "clean_dir: $dir\n"; mtr_print("clean_dir: $dir");
finddepth( finddepth(
{ no_chdir => 1, { no_chdir => 1,
wanted => sub { wanted => sub {
...@@ -3174,12 +3173,12 @@ sub clean_dir { ...@@ -3174,12 +3173,12 @@ sub clean_dir {
# The dir to clean # The dir to clean
return; return;
} else { } else {
print "rmdir: '$_'\n"; mtr_print("rmdir: '$_'");
rmdir($_) or mtr_warning("rmdir($_) failed: $!"); rmdir($_) or mtr_warning("rmdir($_) failed: $!");
} }
} else { } else {
# Hopefully a file # Hopefully a file
print "unlink: '$_'\n"; mtr_print("unlink: '$_'");
unlink($_) or mtr_warning("unlink($_) failed: $!"); unlink($_) or mtr_warning("unlink($_) failed: $!");
} }
} }
...@@ -3192,10 +3191,14 @@ sub clean_datadir { ...@@ -3192,10 +3191,14 @@ sub clean_datadir {
mtr_verbose("Cleaning datadirs..."); mtr_verbose("Cleaning datadirs...");
if (started(all_servers()) != 0){
mtr_error("Trying to clean datadir before all servers stopped");
}
foreach my $cluster ( clusters() ) foreach my $cluster ( clusters() )
{ {
my $cluster_dir= "$opt_vardir/".$cluster->{name}; my $cluster_dir= "$opt_vardir/".$cluster->{name};
mtr_verbose(" - removing '$cluster_dir'"); mtr_print(" - removing '$cluster_dir'");
rmtree($cluster_dir); rmtree($cluster_dir);
} }
...@@ -3204,7 +3207,7 @@ sub clean_datadir { ...@@ -3204,7 +3207,7 @@ sub clean_datadir {
{ {
my $mysqld_dir= dirname($mysqld->value('datadir')); my $mysqld_dir= dirname($mysqld->value('datadir'));
if (-d $mysqld_dir ) { if (-d $mysqld_dir ) {
mtr_verbose(" - removing '$mysqld_dir'"); mtr_print(" - removing '$mysqld_dir'");
rmtree($mysqld_dir); rmtree($mysqld_dir);
} }
} }
...@@ -3509,7 +3512,7 @@ sub mysqld_start ($$) { ...@@ -3509,7 +3512,7 @@ sub mysqld_start ($$) {
sub stop_all_servers () { sub stop_all_servers () {
mtr_report("Stopping all servers..."); mtr_print("Stopping all servers...");
# Kill all started servers # Kill all started servers
My::SafeProcess::shutdown(0, # shutdown timeout 0 => kill My::SafeProcess::shutdown(0, # shutdown timeout 0 => kill
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment