summaryrefslogtreecommitdiff
path: root/mysql-test/lib/My
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/lib/My')
-rw-r--r--mysql-test/lib/My/Config.pm2
-rw-r--r--mysql-test/lib/My/ConfigFactory.pm12
-rw-r--r--mysql-test/lib/My/SafeProcess.pm15
-rw-r--r--mysql-test/lib/My/SafeProcess/CMakeLists.txt4
4 files changed, 27 insertions, 6 deletions
diff --git a/mysql-test/lib/My/Config.pm b/mysql-test/lib/My/Config.pm
index f8416e3df3a..315e415e219 100644
--- a/mysql-test/lib/My/Config.pm
+++ b/mysql-test/lib/My/Config.pm
@@ -188,6 +188,8 @@ sub new {
while ( my $line= <$F> ) {
chomp($line);
+ # Remove any trailing CR from Windows edited files
+ $line=~ s/\cM$//;
# [group]
if ( $line =~ /^\[(.*)\]/ ) {
diff --git a/mysql-test/lib/My/ConfigFactory.pm b/mysql-test/lib/My/ConfigFactory.pm
index ba1f68a9fc9..19c3ee4d5d8 100644
--- a/mysql-test/lib/My/ConfigFactory.pm
+++ b/mysql-test/lib/My/ConfigFactory.pm
@@ -30,6 +30,13 @@ sub get_basedir {
return $basedir;
}
+sub get_testdir {
+ my ($self, $group)= @_;
+ my $testdir= $group->if_exist('testdir') ||
+ $self->{ARGS}->{testdir};
+ return $testdir;
+}
+
# Retrive build directory (which is different from basedir in out-of-source build)
sub get_bindir {
if (defined $ENV{MTR_BINDIR})
@@ -151,9 +158,8 @@ sub fix_secure_file_priv {
sub fix_std_data {
my ($self, $config, $group_name, $group)= @_;
- return my_find_dir($self->get_basedir($group),
- ["share/mysql-test", "mysql-test"],
- "std_data");
+ my $testdir= $self->get_testdir($group);
+ return "$testdir/std_data";
}
sub ssl_supported {
diff --git a/mysql-test/lib/My/SafeProcess.pm b/mysql-test/lib/My/SafeProcess.pm
index b8f05778b6e..461897b56f0 100644
--- a/mysql-test/lib/My/SafeProcess.pm
+++ b/mysql-test/lib/My/SafeProcess.pm
@@ -60,11 +60,12 @@ use My::Platform;
my %running;
my $_verbose= 0;
+my $start_exit= 0;
END {
# Kill any children still running
for my $proc (values %running){
- if ( $proc->is_child($$) ){
+ if ( $proc->is_child($$) and ! $start_exit){
#print "Killing: $proc\n";
if ($proc->wait_one(0)){
$proc->kill();
@@ -161,6 +162,11 @@ sub new {
push(@safe_args, "--");
push(@safe_args, $path); # The program safe_process should execute
+
+ if ($start_exit) { # Bypass safe_process instead, start program directly
+ @safe_args= ();
+ $safe_path= $path;
+ }
push(@safe_args, @$$args);
print "### safe_path: ", $safe_path, " ", join(" ", @safe_args), "\n"
@@ -540,6 +546,13 @@ sub wait_all {
}
}
+#
+# Set global flag to tell all safe_process to exit after starting child
+#
+
+sub start_exit {
+ $start_exit= 1;
+}
#
# Check if any process has exited, but don't wait.
diff --git a/mysql-test/lib/My/SafeProcess/CMakeLists.txt b/mysql-test/lib/My/SafeProcess/CMakeLists.txt
index f79c2d450b9..810096805c8 100644
--- a/mysql-test/lib/My/SafeProcess/CMakeLists.txt
+++ b/mysql-test/lib/My/SafeProcess/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2006 MySQL AB
+# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -11,7 +11,7 @@
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
SET(INSTALL_ARGS
DESTINATION "${INSTALL_MYSQLTESTDIR}/lib/My/SafeProcess"