mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-11 13:40:07 +00:00
Add some extra safety to t/lib/Percona/Toolkit.t in case we are not ebing run under a bzr directory
This commit is contained in:
@@ -22,10 +22,11 @@ foreach my $tool ( @vc_tools ) {
|
||||
my $output = `$tool --version 2>/dev/null`;
|
||||
my ($tool_version) = $output =~ /(\b[0-9]\.[0-9]\.[0-9]\b)/;
|
||||
next unless $tool_version; # Some tools don't have --version implemented
|
||||
my $base = basename($tool);
|
||||
is(
|
||||
$tool_version,
|
||||
$version,
|
||||
"$tool --version and Percona::Toolkit::VERSION agree"
|
||||
"$base --version and Percona::Toolkit::VERSION agree"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -34,8 +35,11 @@ use IPC::Cmd qw(can_run);
|
||||
my $bzr = can_run('bzr');
|
||||
SKIP: {
|
||||
skip "Can't run bzr, skipping tag checking", 1 unless $bzr;
|
||||
|
||||
my @tags = split /\n/, `bzr tags`;
|
||||
chomp(my $root = `$bzr root 2>/dev/null`);
|
||||
skip '$trunk and bzr root differ, skipping tag checking'
|
||||
unless $root eq $trunk;
|
||||
|
||||
my @tags = split /\n/, `$bzr tags`;
|
||||
my ($current_tag) = $tags[-1] =~ /^(\S+)/;
|
||||
|
||||
is(
|
||||
|
Reference in New Issue
Block a user