From: Jarkko Hietaniemi Date: Fri, 23 Oct 1998 14:04:51 +0000 (+0000) Subject: Test suite portability: X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e5e1b98b7a55f8984e74bbc5d6484d24ab6375fa;p=p5sagit%2Fp5-mst-13.2.git 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 --- diff --git a/t/io/pipe.t b/t/io/pipe.t index fc3c0e5..d89bad8 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 b8ec95f..827410a 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 af14f42..e59b4a0 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 89ffff7..2e88311 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";