summaryrefslogtreecommitdiff
path: root/mysql-test/lib
diff options
context:
space:
mode:
authorunknown <kent@mysql.com>2006-02-12 04:13:24 +0100
committerunknown <kent@mysql.com>2006-02-12 04:13:24 +0100
commit0f3d88132068ced7b492047bb7aac8a4a110452b (patch)
tree7fa56d46dd78c475fa1cbab7590ac2507a345b66 /mysql-test/lib
parente147421853af8814479aabd19248bdc6bad92bfe (diff)
downloadmariadb-git-0f3d88132068ced7b492047bb7aac8a4a110452b.tar.gz
spatial.cc:
Added { ... } around float8get() macro, avoids VC7 error message "illegal else without matching if" mtr_report.pl: Parse error logs to create "warnings" file mtr_cases.pl: Added optoion --ignore-disabled-def Windows build now let TZ pass, removed work around mysql-test-run.pl, mtr_process.pl: Back port of changes from 5.0 mysql-test/lib/mtr_process.pl: Back port of changes from 5.0 mysql-test/mysql-test-run.pl: Back port of changes from 5.0 mysql-test/lib/mtr_cases.pl: Added optoion --ignore-disabled-def Windows build now let TZ pass, removed work around mysql-test/lib/mtr_report.pl: Parse error logs to create "warnings" file sql/spatial.cc: Added { ... } around float8get() macro, avoids VC7 error message "illegal else without matching if"
Diffstat (limited to 'mysql-test/lib')
-rw-r--r--mysql-test/lib/mtr_cases.pl7
-rw-r--r--mysql-test/lib/mtr_process.pl25
-rw-r--r--mysql-test/lib/mtr_report.pl74
3 files changed, 66 insertions, 40 deletions
diff --git a/mysql-test/lib/mtr_cases.pl b/mysql-test/lib/mtr_cases.pl
index 158fd602ef8..b75dc04bfec 100644
--- a/mysql-test/lib/mtr_cases.pl
+++ b/mysql-test/lib/mtr_cases.pl
@@ -56,7 +56,7 @@ sub collect_test_cases ($) {
# Disable some tests listed in disabled.def
# ----------------------------------------------------------------------
my %disabled;
- if ( open(DISABLED, "$testdir/disabled.def" ) )
+ if ( ! $::opt_ignore_disabled_def and open(DISABLED, "$testdir/disabled.def" ) )
{
while ( <DISABLED> )
{
@@ -189,8 +189,8 @@ sub collect_one_test_case($$$$$$) {
my $slave_sh= "$testdir/$tname-slave.sh";
my $disabled_file= "$testdir/$tname.disabled";
- $tinfo->{'master_opt'}= $::glob_win32 ? ["--default-time-zone=+3:00"] : [];
- $tinfo->{'slave_opt'}= $::glob_win32 ? ["--default-time-zone=+3:00"] : [];
+ $tinfo->{'master_opt'}= [];
+ $tinfo->{'slave_opt'}= [];
$tinfo->{'slave_mi'}= [];
if ( -f $master_opt_file )
@@ -213,7 +213,6 @@ sub collect_one_test_case($$$$$$) {
if ( defined $value )
{
$tinfo->{'timezone'}= $value;
- $tinfo->{'skip'}= 1 if $::glob_win32; # FIXME server unsets TZ
last MASTER_OPT;
}
diff --git a/mysql-test/lib/mtr_process.pl b/mysql-test/lib/mtr_process.pl
index 177665cf578..dfc4649b1bd 100644
--- a/mysql-test/lib/mtr_process.pl
+++ b/mysql-test/lib/mtr_process.pl
@@ -824,7 +824,7 @@ sub sleep_until_file_created ($$$) {
}
# Check if it died after the fork() was successful
- if ( waitpid($pid,&WNOHANG) == $pid )
+ if ( $pid > 0 && waitpid($pid,&WNOHANG) == $pid )
{
return 0;
}
@@ -848,14 +848,16 @@ sub sleep_until_file_created ($$$) {
sub mtr_kill_processes ($) {
my $pids = shift;
- foreach my $sig (15,9)
+ foreach my $sig (15, 9)
{
- my $retries= 20; # FIXME 20 seconds, this is silly!
- kill($sig, @{$pids});
- while ( $retries-- and kill(0, @{$pids}) )
+ my $retries= 10;
+ while (1)
{
- mtr_debug("Sleep 1 second waiting for processes to die");
- sleep(1) # Wait one second
+ kill($sig, @{$pids});
+ last unless kill (0, @{$pids}) and $retries--;
+
+ mtr_debug("Sleep 2 second waiting for processes to die");
+ sleep(2);
}
}
}
@@ -877,7 +879,14 @@ sub mtr_exit ($) {
# cluck("Called mtr_exit()");
mtr_timer_stop_all($::glob_timers);
local $SIG{HUP} = 'IGNORE';
- kill('HUP', -$$);
+ # ToDo: Signalling -$$ will only work if we are the process group
+ # leader (in fact on QNX it will signal our session group leader,
+ # which might be Do-compile or Pushbuild, causing tests to be
+ # aborted). So we only do it if we are the group leader. We might
+ # set ourselves as the group leader at startup (with
+ # POSIX::setpgrp(0,0)), but then care must be needed to always do
+ # proper child process cleanup.
+ kill('HUP', -$$) if $$ == getpgrp();
sleep 2;
exit($code);
}
diff --git a/mysql-test/lib/mtr_report.pl b/mysql-test/lib/mtr_report.pl
index 515988ee5c7..88ddbf63d0f 100644
--- a/mysql-test/lib/mtr_report.pl
+++ b/mysql-test/lib/mtr_report.pl
@@ -185,39 +185,57 @@ sub mtr_report_stats ($) {
}
# ----------------------------------------------------------------------
+ # If a debug run, there might be interesting information inside
+ # the "var/log/*.err" files. We save this info in "var/log/warnings"
# ----------------------------------------------------------------------
if ( ! $::glob_use_running_server )
{
+ # Save and report if there was any fatal warnings/errors in err logs
- # Report if there was any fatal warnings/errors in the log files
- #
- unlink("$::opt_vardir/log/warnings");
- unlink("$::opt_vardir/log/warnings.tmp");
- # Remove some non fatal warnings from the log files
-
-# FIXME what is going on ????? ;-)
-# sed -e 's!Warning: Table:.* on delete!!g' -e 's!Warning: Setting lower_case_table_names=2!!g' -e 's!Warning: One can only use the --user.*root!!g' \
-# var/log/*.err \
-# | sed -e 's!Warning: Table:.* on rename!!g' \
-# > var/log/warnings.tmp;
-#
-# found_error=0;
-# # Find errors
-# for i in "^Warning:" "^Error:" "^==.* at 0x"
-# do
-# if ( $GREP "$i" var/log/warnings.tmp >> var/log/warnings )
-# {
-# found_error=1
-# }
-# done
-# unlink("$::opt_vardir/log/warnings.tmp");
-# if ( $found_error= "1" )
-# {
-# print "WARNING: Got errors/warnings while running tests. Please examine\n"
-# print "$::opt_vardir/log/warnings for details.\n"
-# }
-# }
+ my $warnlog= "$::opt_vardir/log/warnings";
+
+ unless ( open(WARN, ">$warnlog") )
+ {
+ mtr_warning("can't write to the file \"$warnlog\": $!");
+ }
+ else
+ {
+ my $found_problems= 0; # Some warnings are errors...
+
+ # We report different types of problems in order
+ foreach my $pattern ( "^Warning:", "^Error:", "^==.* at 0x" )
+ {
+ foreach my $errlog ( sort glob("$::opt_vardir/log/*.err") )
+ {
+ unless ( open(ERR, $errlog) )
+ {
+ mtr_warning("can't read $errlog");
+ next;
+ }
+ while ( <ERR> )
+ {
+ # Skip some non fatal warnings from the log files
+ if ( /Warning:\s+Table:.* on (delete|rename)/ or
+ /Warning:\s+Setting lower_case_table_names=2/ or
+ /Warning:\s+One can only use the --user.*root/ )
+ {
+ next; # Skip these lines
+ }
+ if ( /$pattern/ )
+ {
+ $found_problems= 1;
+ print WARN $_;
+ }
+ }
+ }
+ if ( $found_problems )
+ {
+ mtr_warning("Got errors/warnings while running tests, please examine",
+ "\"$warnlog\" for details.");
+ }
+ }
+ }
}
print "\n";