use modern modules and blahblah
from openbsd, by Han Boetes originally also, clean up comments a bit
This commit is contained in:
parent
5b6017fd0f
commit
1f32407004
27
check.pl
27
check.pl
@ -1,9 +1,7 @@
|
|||||||
#!/usr/bin/perl
|
#!/usr/bin/perl
|
||||||
# $MirOS: src/bin/mksh/check.pl,v 1.4 2005/06/05 16:38:19 tg Exp $
|
# $MirOS: src/bin/mksh/check.pl,v 1.5 2005/06/08 11:06:45 tg Exp $
|
||||||
# $OpenBSD: th,v 1.11 2004/11/29 06:20:02 jsg Exp $
|
# $OpenBSD: th,v 1.12 2005/05/28 04:53:47 millert Exp $
|
||||||
#-
|
#-
|
||||||
# Test harness for pdksh tests.
|
|
||||||
#
|
|
||||||
# Example test:
|
# Example test:
|
||||||
# name: a-test
|
# name: a-test
|
||||||
# description:
|
# description:
|
||||||
@ -127,14 +125,12 @@
|
|||||||
# The value must start and end with the f-s-c.
|
# The value must start and end with the f-s-c.
|
||||||
# p tag takes parameters (used with m).
|
# p tag takes parameters (used with m).
|
||||||
# s tag can be used several times.
|
# s tag can be used several times.
|
||||||
#
|
|
||||||
|
use POSIX qw(EINTR);
|
||||||
|
use Getopt::Std;
|
||||||
|
|
||||||
$os = defined $^O ? $^O : 'unknown';
|
$os = defined $^O ? $^O : 'unknown';
|
||||||
|
|
||||||
require 'signal.ph' unless $os eq 'os2';
|
|
||||||
require 'errno.ph' unless $os eq 'os2';
|
|
||||||
require 'getopts.pl';
|
|
||||||
|
|
||||||
($prog = $0) =~ s#.*/##;
|
($prog = $0) =~ s#.*/##;
|
||||||
|
|
||||||
$Usage = <<EOF ;
|
$Usage = <<EOF ;
|
||||||
@ -154,9 +150,7 @@ Usage: $prog [-s test-set] [-C category] [-p prog] [-v] [-e e=v] test-name ...
|
|||||||
specified, all tests are run.
|
specified, all tests are run.
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
#
|
|
||||||
# See comment above for flag meanings
|
# See comment above for flag meanings
|
||||||
#
|
|
||||||
%test_fields = (
|
%test_fields = (
|
||||||
'name', 'r',
|
'name', 'r',
|
||||||
'description', 'm',
|
'description', 'm',
|
||||||
@ -186,7 +180,6 @@ EOF
|
|||||||
# Categories of the program under test. Provide the current
|
# Categories of the program under test. Provide the current
|
||||||
# os by default.
|
# os by default.
|
||||||
%categories = (
|
%categories = (
|
||||||
# (defined $^O ? "os:$^O" : "os:unknown"), '1'
|
|
||||||
"os:$os", '1'
|
"os:$os", '1'
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -203,7 +196,7 @@ $nxpassed = 0;
|
|||||||
|
|
||||||
%known_tests = ();
|
%known_tests = ();
|
||||||
|
|
||||||
if (!&Getopts('C:p:Ps:t:ve:')) {
|
if (!getopts('C:p:Ps:t:ve:')) {
|
||||||
print STDERR $Usage;
|
print STDERR $Usage;
|
||||||
exit 1;
|
exit 1;
|
||||||
}
|
}
|
||||||
@ -516,7 +509,7 @@ run_test
|
|||||||
$xpid = waitpid($pid, 0);
|
$xpid = waitpid($pid, 0);
|
||||||
$child_kill_ok = 0;
|
$child_kill_ok = 0;
|
||||||
if ($xpid < 0) {
|
if ($xpid < 0) {
|
||||||
next if $! == &EINTR;
|
next if $! == EINTR;
|
||||||
print STDERR "$prog: error waiting for child - $!\n";
|
print STDERR "$prog: error waiting for child - $!\n";
|
||||||
return undef;
|
return undef;
|
||||||
}
|
}
|
||||||
@ -1205,3 +1198,9 @@ check_file_result
|
|||||||
|
|
||||||
return $why;
|
return $why;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sub HELP_MESSAGE
|
||||||
|
{
|
||||||
|
print STDERR $Usage;
|
||||||
|
exit 0;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user