From a5903ed9f322ade1a3bab7e6c7ddc8236b7b3f05 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Sep 2005 13:12:30 +0200 Subject: [PATCH 1/2] Minor output format change of the Perl test suite script (align with the shell script). mysql-test/lib/mtr_report.pl: Make the Perl test script output identical to that of the (old) shell script, so that reported differences compare as equal strings (for automatic analysis). --- mysql-test/lib/mtr_report.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 868653afaa4..6db68524db7 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -74,7 +74,7 @@ sub mtr_show_failed_diff ($) { sub mtr_report_test_name ($) { my $tinfo= shift; - printf "%-31s ", $tinfo->{'name'}; + printf "%-30s ", $tinfo->{'name'}; } sub mtr_report_test_skipped ($) { @@ -122,13 +122,13 @@ sub mtr_report_test_failed ($) { # we should write out into $::path_timefile when the error occurs. if ( -f $::path_timefile ) { - print "Errors are (from $::path_timefile) :\n"; + print "\nErrors are (from $::path_timefile) :\n"; print mtr_fromfile($::path_timefile); # FIXME print_file() instead print "\n(the last lines may be the most important ones)\n"; } else { - print "Unexpected termination, probably when starting mysqld\n"; + print "\nUnexpected termination, probably when starting mysqld\n"; } } From abd4974fd5c1405da1794bf7fe0999e37a7e485e Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 14 Sep 2005 13:55:53 +0200 Subject: [PATCH 2/2] Improve error / process handling in the Perl script to run the test suite (patch supplied by Kent). mysql-test/lib/mtr_process.pl: Handle errors in child processes separate from the parent process (patch supplied by Kent). mysql-test/lib/mtr_report.pl: New function to handle errors in child processes separate from the parent process (patch supplied by Kent). Expected to avoid HUP signals. --- mysql-test/lib/mtr_process.pl | 10 +++++----- mysql-test/lib/mtr_report.pl | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl index bae66353825..9176a246835 100644 --- a/mysql-test/lib/mtr_process.pl +++ b/mysql-test/lib/mtr_process.pl @@ -166,7 +166,7 @@ sub spawn_impl ($$$$$$$$) { { if ( ! open(STDOUT,$log_file_open_mode,$output) ) { - mtr_error("can't redirect STDOUT to \"$output\": $!"); + mtr_child_error("can't redirect STDOUT to \"$output\": $!"); } } @@ -176,14 +176,14 @@ sub spawn_impl ($$$$$$$$) { { if ( ! open(STDERR,">&STDOUT") ) { - mtr_error("can't dup STDOUT: $!"); + mtr_child_error("can't dup STDOUT: $!"); } } else { if ( ! open(STDERR,$log_file_open_mode,$error) ) { - mtr_error("can't redirect STDERR to \"$error\": $!"); + mtr_child_error("can't redirect STDERR to \"$error\": $!"); } } } @@ -192,13 +192,13 @@ sub spawn_impl ($$$$$$$$) { { if ( ! open(STDIN,"<",$input) ) { - mtr_error("can't redirect STDIN to \"$input\": $!"); + mtr_child_error("can't redirect STDIN to \"$input\": $!"); } } if ( ! exec($path,@$arg_list_t) ) { - mtr_error("failed to execute \"$path\": $!"); + mtr_child_error("failed to execute \"$path\": $!"); } } } diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl index 6db68524db7..9002f204602 100644 --- a/mysql-test/lib/mtr_report.pl +++ b/mysql-test/lib/mtr_report.pl @@ -19,6 +19,7 @@ sub mtr_print_header (); sub mtr_report (@); sub mtr_warning (@); sub mtr_error (@); +sub mtr_child_error (@); sub mtr_debug (@); @@ -286,6 +287,11 @@ sub mtr_error (@) { mtr_exit(1); } +sub mtr_child_error (@) { + print STDERR "mysql-test-run: *** ERROR(child): ",join(" ", @_),"\n"; + exit(1); +} + sub mtr_debug (@) { if ( $::opt_script_debug ) {