version 1.2, 2007/02/05 19:21:02 |
version 1.3, 2007/02/05 19:39:33 |
|
|
use strict; |
use strict; |
use warnings; |
use warnings; |
use Module::Build; |
use Module::Build; |
# $RedRiver: Build.PL,v 1.1 2007/02/05 18:10:55 andrew Exp $ |
use File::Spec; |
|
# $RedRiver: Build.PL,v 1.2 2007/02/05 19:21:02 andrew Exp $ |
|
|
my $cfg_file = File::Spec->catfile('t', 'do_network.tests'); |
my $cfg_file = File::Spec->catfile('t', 'do_network.tests'); |
|
|
|
|
add_to_cleanup => [ 'Net-Telnet-Trango-*', $cfg_file ], |
add_to_cleanup => [ 'Net-Telnet-Trango-*', $cfg_file ], |
); |
); |
|
|
get_config(); |
my %cfg; |
|
get_ap_config(\%cfg); |
|
|
|
if (%cfg && open T,">$cfg_file") { |
|
while (my ($key, $value) = each %cfg) { |
|
print T $key, "\t", $value,"\n"; |
|
} |
|
close T; |
|
} |
|
|
$builder->create_build_script(); |
$builder->create_build_script(); |
|
|
sub get_config |
sub get_ap_config |
{ |
{ |
my %cfg; |
my $cfg = shift; |
|
|
print <<EOB; |
print <<EOB; |
|
|
Net::Telnet::Trango needs to log into an AP to |
Net::Telnet::Trango needs to log into an AP to |
perform it\'s full suite of tests. To log in, we |
perform it\'s full suite of tests. To log in, we |
need a test AP, a login, a password. |
need a test AP and a password. |
|
|
To skip these tests, hit "return". |
To skip these tests, hit "return". |
|
|
EOB |
EOB |
|
|
$cfg{AP} = $builder->prompt("AP: ", $cfg{AP}) || return; |
$cfg->{AP} = $builder->prompt("AP: ", $cfg->{AP}) || return; |
$cfg{PASSWD} = $builder->prompt("Password:", $cfg{PASSWD}) || return; |
$cfg->{PASSWD} = $builder->prompt("Password:", $cfg->{PASSWD}) || return; |
|
|
if (open T,">$cfg_file") { |
|
while (my ($key, $value) = each %cfg) { |
|
print T $key, "\t", $value,"\n"; |
|
} |
|
close T; |
|
} |
|
} |
} |