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
mtr_print_header mtr_report mtr_report_stats
mtr_warning mtr_error mtr_debug mtr_verbose
mtr_verbose_restart mtr_report_test_passed
mtr_report_test_skipped
mtr_report_test_skipped mtr_print
mtr_report_test);
use mtr_match;
......@@ -386,8 +386,13 @@ sub _timestamp {
$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 (@) {
if (defined $verbose)
{
......
......@@ -2895,7 +2895,6 @@ sub run_testcase ($) {
if ($check_res == 1) {
# Test case had sideeffects, not fatal error, just continue
stop_all_servers();
clean_datadir();
mtr_report("Resuming tests...\n");
}
else {
......@@ -3164,7 +3163,7 @@ sub check_expected_crash_and_restart {
# Remove all files and subdirectories of a directory
sub clean_dir {
my ($dir)= @_;
print "clean_dir: $dir\n";
mtr_print("clean_dir: $dir");
finddepth(
{ no_chdir => 1,
wanted => sub {
......@@ -3174,12 +3173,12 @@ sub clean_dir {
# The dir to clean
return;
} else {
print "rmdir: '$_'\n";
mtr_print("rmdir: '$_'");
rmdir($_) or mtr_warning("rmdir($_) failed: $!");
}
} else {
# Hopefully a file
print "unlink: '$_'\n";
mtr_print("unlink: '$_'");
unlink($_) or mtr_warning("unlink($_) failed: $!");
}
}
......@@ -3192,10 +3191,14 @@ sub clean_datadir {
mtr_verbose("Cleaning datadirs...");
if (started(all_servers()) != 0){
mtr_error("Trying to clean datadir before all servers stopped");
}
foreach my $cluster ( clusters() )
{
my $cluster_dir= "$opt_vardir/".$cluster->{name};
mtr_verbose(" - removing '$cluster_dir'");
mtr_print(" - removing '$cluster_dir'");
rmtree($cluster_dir);
}
......@@ -3204,7 +3207,7 @@ sub clean_datadir {
{
my $mysqld_dir= dirname($mysqld->value('datadir'));
if (-d $mysqld_dir ) {
mtr_verbose(" - removing '$mysqld_dir'");
mtr_print(" - removing '$mysqld_dir'");
rmtree($mysqld_dir);
}
}
......@@ -3509,7 +3512,7 @@ sub mysqld_start ($$) {
sub stop_all_servers () {
mtr_report("Stopping all servers...");
mtr_print("Stopping all servers...");
# Kill all started servers
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