|
|
|
@ -40,7 +40,7 @@ around('ACTION_test', sub {
|
|
|
|
|
|
|
|
|
|
require Getopt::Long;
|
|
|
|
|
my %opt = (server => 'http://localhost:5000');
|
|
|
|
|
Getopt::Long::GetOptions(\%opt, 'webdriver=s', 'server:s', 'help|?', 'man')
|
|
|
|
|
Getopt::Long::GetOptions(\%opt, 'webdriver=s', 'server:s', 'help|?', 'man', 'wd-server=s')
|
|
|
|
|
or die 'could not process command-line options';
|
|
|
|
|
|
|
|
|
|
require Pod::Usage;
|
|
|
|
@ -48,6 +48,12 @@ around('ACTION_test', sub {
|
|
|
|
|
Pod::Usage::pod2usage(-exitval => 0, -input => 'Build.PL', -verbose => 2) if $opt{man};
|
|
|
|
|
Pod::Usage::pod2usage("$0: --webdriver option required.\nRun `perldoc Build.PL`") unless $opt{webdriver};
|
|
|
|
|
|
|
|
|
|
if ($opt{'wd-server'}) {
|
|
|
|
|
my ($wd_host, $wd_port) = $opt{'wd-server'} =~ m{([^/:]+):([0-9]+)};
|
|
|
|
|
$ENV{TWD_HOST} = $wd_host;
|
|
|
|
|
$ENV{TWD_PORT} = $wd_port;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
unless ($opt{webdriver} eq "external") {
|
|
|
|
|
$webdriver = child { exec $opt{webdriver} };
|
|
|
|
|
$self->wait_socket(qw(localhost 4444));
|
|
|
|
|