diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 1998-10-23 14:04:51 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1998-10-23 14:04:51 +0000 |
commit | e5e1b98b7a55f8984e74bbc5d6484d24ab6375fa (patch) | |
tree | 2b46fbb00458031e1ab1628d5dfc5a46dfbbd679 | |
parent | d5047e5685a6d509cc9a4660c26c3d2a0bc7afe6 (diff) | |
download | perl-e5e1b98b7a55f8984e74bbc5d6484d24ab6375fa.tar.gz |
Test suite portability:
- posix-bc does not write to broken pipes
- filehand #11 only iff we have fork
- warning.t can now match $expected using regular expressions
p4raw-id: //depot/cfgperl@2037
-rwxr-xr-x | t/io/pipe.t | 3 | ||||
-rwxr-xr-x | t/lib/filehand.t | 3 | ||||
-rw-r--r-- | t/pragma/warn/doio | 6 | ||||
-rwxr-xr-x | t/pragma/warning.t | 20 |
4 files changed, 25 insertions, 7 deletions
diff --git a/t/io/pipe.t b/t/io/pipe.t index fc3c0e5221..d89bad8c4f 100755 --- a/t/io/pipe.t +++ b/t/io/pipe.t @@ -89,11 +89,12 @@ if ($^O eq 'VMS') { exit; } -if ($Config{d_sfio} || $^O eq machten || $^O eq beos) { +if ($Config{d_sfio} || $^O eq 'machten' || $^O eq 'beos' || $^O eq 'posix-bc') { # Sfio doesn't report failure when closing a broken pipe # that has pending output. Go figure. MachTen doesn't either, # but won't write to broken pipes, so nothing's pending at close. # BeOS will not write to broken pipes, either. + # Nor does POSIX-BC. print "ok 9\n"; } else { diff --git a/t/lib/filehand.t b/t/lib/filehand.t index b8ec95f320..827410a96a 100755 --- a/t/lib/filehand.t +++ b/t/lib/filehand.t @@ -72,7 +72,8 @@ if ($^O eq 'dos') ($rd,$wr) = FileHandle::pipe; -if ($^O eq 'VMS' || $^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'MSWin32') { +if ($^O eq 'VMS' || $^O eq 'os2' || $^O eq 'amigaos' || $^O eq 'MSWin32' || + $Config{d_fork} ne 'define') { $wr->autoflush; $wr->printf("ok %d\n",11); print $rd->getline; diff --git a/t/pragma/warn/doio b/t/pragma/warn/doio index af14f42272..e59b4a0224 100644 --- a/t/pragma/warn/doio +++ b/t/pragma/warn/doio @@ -85,10 +85,12 @@ Unsuccessful stat on filename containing newline at - line 4. use warning 'io' ; exec "lskdjfalksdjfdjfkls","" ; EXPECT -Can't exec "lskdjfalksdjfdjfkls": No such file or directory at - line 3. +OPTION regex +Can't exec "lskdjfalksdjfdjfkls": (\w+ )?No such file or directory\.? at - line 3. ######## # doio.c use warning 'io' ; exec "lskdjfalksdjfdjfkls", "abc" ; EXPECT -Can't exec "lskdjfalksdjfdjfkls": No such file or directory at - line 3. +OPTION regex +Can't exec "lskdjfalksdjfdjfkls": (\w+ )?No such file or directory\.? at - line 3. diff --git a/t/pragma/warning.t b/t/pragma/warning.t index 89ffff789a..2e88311c6c 100755 --- a/t/pragma/warning.t +++ b/t/pragma/warning.t @@ -4,11 +4,12 @@ BEGIN { chdir 't' if -d 't'; @INC = '../lib'; $ENV{PERL5LIB} = '../lib'; + require Config; import Config; } $| = 1; -my $Is_VMS = $^O eq 'VMS'; +my $Is_VMS = $^O eq 'VMS'; my $Is_MSWin32 = $^O eq 'MSWin32'; my $tmpfile = "tmp0000"; my $i = 0 ; @@ -86,11 +87,24 @@ for (@prgs){ $results =~ s/\n%[A-Z]+-[SIWEF]-.*$// if $Is_VMS; # clip off DCL status msg $expected =~ s/\n+$//; my $prefix = ($results =~ s/^PREFIX\n//) ; + # any special options? (OPTIONS foo bar zap) + my $option_regex = 0; + if ($expected =~ s/^OPTIONS? (.+)\n//) { + foreach my $option (split(' ', $1)) { + if ($option eq 'regex') { # allow regular expressions + $option_regex = 1; + } else { + die "$0: Unknown OPTION '$option'\n"; + } + } + } if ( $results =~ s/^SKIPPED\n//) { print "$results\n" ; } - elsif (($prefix and $results !~ /^\Q$expected/) or - (!$prefix and $results ne $expected)){ + elsif (($prefix && (( $option_regex && $results !~ /^$expected/) || + (!$option_regex && $results !~ /^\Q$expected/))) or + (!$prefix && (( $option_regex && $results !~ /^$expected/) || + (!$option_regex && $results ne $expected)))) { print STDERR "PROG: $switch\n$prog\n"; print STDERR "EXPECTED:\n$expected\n"; print STDERR "GOT:\n$results\n"; |