Files
percona-toolkit/t/pt-pmp/pt-pmp.t
Sveta Smirnova 08946bcbba Port improved pt-pmp
- Added test cases for proper reading of eu-stack dumps (when option
  --dumper not default)
2024-01-18 20:27:03 +03:00

57 lines
1.4 KiB
Perl

#!/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 PerconaTest;
use Test::More;
my $sample = "$trunk/t/pt-pmp/samples";
opendir my $dh, $sample or die "Error opening $sample: $OS_ERROR";
while ( my $file = readdir $dh ) {
next unless -f "$sample/$file" && "$sample/$file" =~ m/\.in$/;
(my $outfile = $file) =~ s/\.in/.out/;
ok(
no_diff(
"$trunk/bin/pt-pmp $sample/$file",
"t/pt-pmp/samples/$outfile",
),
"$file"
) or diag($test_diff);
}
closedir $dh;
ok(
no_diff(
"$trunk/bin/pt-pmp -l 2 $sample/stacktrace003.in",
"t/pt-pmp/samples/stacktrace003-limit2.out",
),
"Limit 2 (stacktrace003-limit2.out)"
) or diag($test_diff);
ok(
no_diff(
"$trunk/bin/pt-pmp -d eu $sample/stacktrace006-eu.in",
"t/pt-pmp/samples/stacktrace006-eu-deu.out",
),
"eu-stack dump read correctly if option -d eu specified"
) or diag($test_diff);
ok(
no_diff(
"$trunk/bin/pt-pmp -d pteu $sample/stacktrace006-pteu.in",
"t/pt-pmp/samples/stacktrace006-pteu-dpteu.out",
),
"pt-eustack-resolver dump read correctly if option -d pteu specified"
) or diag($test_diff);
done_testing;