FUNCTION
Run all testcases, collect and analyse the output.
FUNCTION
The executable to run and list the testcases.
SOURCE
my $tester = "./robotester";
FUNCTION
Run a testcase and analyse the output to see if the testcase failed. A testcase failed if the output contains the word "FAIL:" or when it does not contain the word "COMPLETE:".
INPUTS
o $name -- the name of the testcase to run.
SOURCE
sub run_testcase {
my $name = shift;
my @output = ();
my $result = "FAIL";
my @failures = ();
my @complete = ();
print "-" x 75, "\n";
printf("%-65s", $name);
@output = `$tester run $name`;
@failures = grep { $_ =~ m/^FAIL:/ } @output;
@complete = grep { $_ =~ m/^COMPLETE:/ } @output;
if ( ( scalar( @failures ) == 0 ) and
( scalar( @complete ) == 1 ) ) {
$result = "OK";
}
print " $result\n";
print "-" x 75, "\n";
print @output;
}