- my $logfile = shift();
- my $testno = shift();
- my $detail = shift() || '';
- if ( open(my $fh, ">>", $logfile) ) {
- print $fh "Test $testno $detail failed\n";
- close $fh;
- }
+ my ($logfile, $testno, $detail) = @_;
+
+ open(my $fh, '>>', $logfile) or return;
+
+ print $fh "Test $testno "
+ . (defined $detail ? "$detail " : '')
+ . "failed\n";
+}
+
+# Computer-readable summary results logfile
+
+sub log_test {
+ my ($logfile, $testno, $resultchar) = @_;
+
+ open(my $fh, '>>', $logfile) or return;
+ print $fh "$testno $resultchar\n";