Subject: | Endless looping with automated testing |
The _ask() function in t/lib/Apache/test.pm can be written as:
sub _ask {
# Just a function for asking the user questions
my ($prompt, $default, $mustfind, $canskip) = @_;
my ($responded,$count,$limit) = (0,0,2);
my $skip = defined $canskip ? " ('$canskip' to skip)" : '';
my $response;
do {
print "$prompt [$default]$skip: ";
chomp($response = <STDIN>);
$response ||= $default;
unless(!$mustfind || ($response eq $canskip) || (-e $response || !print("$response not found\n"))) {
$count++;
} else {
$responded = 1;
}
} until ($responded || $count > $limit);
return $canskip if($count > $limit);
return $response;
}
This may be incomplete, but it does stop the cycle of the default path '/usr/lib/httpd/httpd' not being found and then the check looping forever, or until CTL-C is hit. I suspect some of the recent FAIL reports are due to this.
<P>
Note that the default install location for Win32 is 'C:\Program Files\Apache Group\Apache\Apache.exe'.