mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-12-24 02:01:42 +08:00
Add forked Maatkit tools in bin/ and their tests in t/.
This commit is contained in:
36
t/pt-query-digest/statistics.t
Normal file
36
t/pt-query-digest/statistics.t
Normal file
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env perl
|
||||
|
||||
BEGIN {
|
||||
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
|
||||
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
|
||||
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
|
||||
};
|
||||
|
||||
use strict;
|
||||
use warnings FATAL => 'all';
|
||||
use English qw(-no_match_vars);
|
||||
use Test::More tests => 1;
|
||||
|
||||
use MaatkitTest;
|
||||
|
||||
# See 101_slowlog_analyses.t or http://code.google.com/p/maatkit/wiki/Testing
|
||||
shift @INC; # our unshift (above)
|
||||
shift @INC; # MaatkitTest's unshift
|
||||
|
||||
require "$trunk/bin/pt-query-digest";
|
||||
|
||||
my @args = qw(--no-report --statistics);
|
||||
my $sample = "$trunk/t/lib/samples/slowlogs/";
|
||||
|
||||
ok(
|
||||
no_diff(
|
||||
sub { mk_query_digest::main(@args, $sample.'slow002.txt') },
|
||||
"t/pt-query-digest/samples/stats-slow002.txt"
|
||||
),
|
||||
'--statistics for slow002.txt',
|
||||
);
|
||||
|
||||
# #############################################################################
|
||||
# Done.
|
||||
# #############################################################################
|
||||
exit;
|
||||
Reference in New Issue
Block a user