1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
use ExtUtils::MakeMaker;
# See lib/ExtUtils/MakeMaker.pm for details of how to influence
# the contents of the Makefile that is written.
WriteMakefile(
'DIR' => ['BodyStructure', 'Parse'],
'NAME' => 'Mail::IMAPClient',
'VERSION_FROM' => 'IMAPClient.pm', # finds $VERSION
'clean' => { FILES => 'test.txt' }
);
&set_test_data;
sub set_test_data {
unless (-f "./IMAPClient.pm") { warn "ERROR: not in installation directory\n"; return }
return if -f "./test.txt";
print "You have the option of running an extended suite of tests during\n",
"'make test'. This requires an IMAP server name, user account, and ",
"password to test with.","\n","\n",
"Do you want to run the extended tests? (n/y) ==> ";
my $yes = <STDIN>;
return unless $yes =~ /^[Yy](?:[Ee]:[Ss]?)?$/ ;
unless (open TST,">./test.txt") { warn "ERROR: couldn't open ./test.txt: $!\n"; return }
print "\nPlease provide the hostname of a host running an IMAP server \n",
"(or QUIT to skip the extended tests) ==> ";
my $server = <STDIN>;
chomp $server;
return if $server =~ /^\s+$|^quit$/i ;
print TST "server=$server\n";
print "\nPlease provide the username of an account\non $server (or QUIT) ==> ";
my $user = <STDIN>;
chomp $user;
return if $user =~ /^\s+$|^quit$/i ;
print TST "user=$user\n";
print "\nPlease provide the password for $user\n(or QUIT) ==> ";
my $passed = <STDIN>;
chomp $passed;
return if $passed =~ /^\s+$|^quit$/i ;
print TST "passed=$passed\n";
print "\nPlease provide the port to connect to on $server to run the test \n",
"(default is 143) ==> ";
my $port = <STDIN>;
chomp $port;
$port ||= 143;
print TST "port=$port\n";
close TST;
print "\nGracias! The information you provided (including the \n",
" password!) has been stored in ",cwd,"/test.txt and should be\n",
" removed (either by hand or by 'make clean') after testing.\n";
}
|