mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-12 06:00:14 +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 $output = `$tool --version 2>/dev/null`;
|
||||||
my ($tool_version) = $output =~ /(\b[0-9]\.[0-9]\.[0-9]\b)/;
|
my ($tool_version) = $output =~ /(\b[0-9]\.[0-9]\.[0-9]\b)/;
|
||||||
next unless $tool_version; # Some tools don't have --version implemented
|
next unless $tool_version; # Some tools don't have --version implemented
|
||||||
|
my $base = basename($tool);
|
||||||
is(
|
is(
|
||||||
$tool_version,
|
$tool_version,
|
||||||
$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');
|
my $bzr = can_run('bzr');
|
||||||
SKIP: {
|
SKIP: {
|
||||||
skip "Can't run bzr, skipping tag checking", 1 unless $bzr;
|
skip "Can't run bzr, skipping tag checking", 1 unless $bzr;
|
||||||
|
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 @tags = split /\n/, `$bzr tags`;
|
||||||
my ($current_tag) = $tags[-1] =~ /^(\S+)/;
|
my ($current_tag) = $tags[-1] =~ /^(\S+)/;
|
||||||
|
|
||||||
is(
|
is(
|
||||||
|
Reference in New Issue
Block a user