mirror of
https://github.com/percona/percona-toolkit.git
synced 2026-04-09 01:04:44 +08:00
pt-mysql-summary 2.0
This commit is contained in:
@@ -16,4 +16,44 @@ my ($tool) = $PROGRAM_NAME =~ m/([\w-]+)\.t$/;
|
||||
push @ARGV, "$trunk/t/$tool/*.sh" unless @ARGV;
|
||||
system("$trunk/util/test-bash-functions $trunk/bin/$tool @ARGV");
|
||||
|
||||
require Test::More;
|
||||
Test::More->import( tests => 3 );
|
||||
use File::Temp qw( tempdir );
|
||||
|
||||
local $ENV{PTDEBUG} = "";
|
||||
|
||||
#
|
||||
# --tempdir
|
||||
#
|
||||
my $dir = tempdir( CLEANUP => 1 );
|
||||
|
||||
`$trunk/bin/$tool --sleep 1 --tempdir $dir`;
|
||||
|
||||
ok(
|
||||
-e $dir,
|
||||
"Using --tempdir doesn't mistakenly delete the target dir"
|
||||
);
|
||||
|
||||
my @files = glob("$dir/*");
|
||||
|
||||
is(
|
||||
scalar @files,
|
||||
14,
|
||||
"And leaves all files in there"
|
||||
);
|
||||
|
||||
undef($dir);
|
||||
|
||||
#
|
||||
# --dump-schemas
|
||||
#
|
||||
|
||||
my $out = `$trunk/bin/$tool --sleep 1 --dump-schemas mysql`;
|
||||
|
||||
like(
|
||||
$out,
|
||||
qr/Database Tables Views SPs Trigs Funcs FKs Partn\s+\Q{chosen}\E/,
|
||||
"--dump-schemas works"
|
||||
);
|
||||
|
||||
exit;
|
||||
|
||||
Reference in New Issue
Block a user