Skip to content

Commit

Permalink
When running subprocesses in client tests, use test runner's perl and…
Browse files Browse the repository at this point in the history
… gearmand instead of environment's

git-svn-id: http://code.sixapart.com/svn/gearman/trunk@484 011c6a6d-750f-0410-a5f6-93fdcd050bc4
  • Loading branch information
athomason committed May 17, 2011
1 parent 493a984 commit f0e7b5c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions t/TestGearman.pm
Expand Up @@ -2,6 +2,7 @@ package TestGearman;
use base qw(Exporter);
@EXPORT = qw(start_server wait_for_port start_worker respawn_children pid_is_dead PORT %Children $NUM_SERVERS);
use strict;
use File::Basename 'dirname';
use List::Util qw(first);;
use IO::Socket::INET;
use POSIX qw( :sys_wait_h );
Expand All @@ -22,6 +23,7 @@ sub start_server {
my($port) = @_;
my @loc = ("$Bin/../../../../server/gearmand", # using svn
"$Bin/../../../../../server/gearmand", # using svn and 'disttest'
dirname($^X) . '/gearmand', # local installs (e.g. perlbrew)
'/usr/bin/gearmand', # where some distros might put it
'/usr/sbin/gearmand', # where other distros might put it
);
Expand Down
4 changes: 3 additions & 1 deletion t/lib/GearTestLib.pm
Expand Up @@ -3,6 +3,7 @@ use strict;
use IO::Socket::INET;
use Exporter 'import';
use FindBin;
use File::Basename 'dirname';
use Carp qw(croak);
use vars qw(@EXPORT);

Expand Down Expand Up @@ -33,7 +34,7 @@ sub start_child {
my $pid = fork();
die $! unless defined $pid;
unless ($pid) {
exec 'perl', '-Iblib/lib', '-Ilib', @$cmd or die $!;
exec $^X, '-Iblib/lib', '-Ilib', @$cmd or die $!;
}
$pid;
}
Expand All @@ -48,6 +49,7 @@ sub new {
my $port = GearTestLib::free_port(++$requested_port);

my @loc = ("$FindBin::Bin/../../../../server/gearmand", # using svn
dirname($^X) . '/gearmand', # local installs (e.g. perlbrew)
'/usr/bin/gearmand', # where some distros might put it
'/usr/sbin/gearmand', # where other distros might put it
);
Expand Down

0 comments on commit f0e7b5c

Please sign in to comment.