1
0
mirror of https://github.com/MariaDB/server.git synced 2025-05-10 02:01:19 +03:00
mariadb/mysql-test/lib/My/Handles.pm
Sergei Golubchik 8da7be6302 generalization of mtr to support suite.pm extensions:
* no automatic --loose-skip-innodb added by mtr based on the test name.
  instead loose-skip-innodb is now in the default_mysqld.cnf
* have_innodb_plugin.inc is changed to give a verbose "skip" message
  (instead of "require: true")
* My::Suite class. It's support in mtr, and everywhere
* support for suite.pm
* when sorting tests, take combinations into account
* support for SUITENAME_COMBINATIONS
* no special treatment for innodb_plugin in mtr_cases.pm
* two special pre-created config groups: ENV and OPT
* allow option names to start from #
* allow magic option to have an argument
* remove dead code
* fix @-substitution to works as expected
* new processes take the value of $opt_verbose automatically, no need to pass it to a constructor
* innodb_plugin suite uses suite.pm and combinations file to test as much as possible
  (innodb plugin, xtradb plugin, xtradb static - whatever available)
* besides test-master.opt and test-slave.opt a test.opt file is also
  loaded, both for master and slave
* .opt files for all included files are loaded too
* progress report in the xterm titlebar
2010-08-17 11:14:46 +04:00

70 lines
1.6 KiB
Perl

# -*- cperl -*-
# Copyright (C) 2008 MySQL AB
#
# 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
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# 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
package My::Handles;
use strict;
use Carp;
use My::Platform;
my $handle_exe;
if (IS_WINDOWS){
# Check if handle.exe is available
# Pass switch to accept the EULA to avoid hanging
# if the program hasn't been run before.
my $list= `handle.exe -? -accepteula 2>&1`;
foreach my $line (split('\n', $list))
{
$handle_exe= "$1.$2"
if ($line =~ /Handle v([0-9]*)\.([0-9]*)/);
}
if ($handle_exe){
print "Found handle.exe version $handle_exe\n";
}
}
sub show_handles
{
my ($dir)= @_;
return unless $handle_exe;
return unless $dir;
$dir= native_path($dir);
# Get a list of open handles in a particular directory
my $list= `handle.exe "$dir" 2>&1` or return;
foreach my $line (split('\n', $list))
{
return if ($line =~ /No matching handles found/);
}
print "\n";
print "=" x 50, "\n";
print "Open handles in '$dir':\n";
print "$list\n";
print "=" x 50, "\n\n";
return;
}
1;