This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Refactor 5 tests to use skip_all(), instead of generating TAP locally.
authorNicholas Clark <nick@ccl4.org>
Mon, 7 Mar 2011 17:36:55 +0000 (17:36 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 7 Mar 2011 17:36:55 +0000 (17:36 +0000)
t/io/layers.t
t/io/through.t
t/op/fork.t
t/op/lfs.t
t/uni/lex_utf8.t

index 4e42043..d0b55f1 100644 (file)
@@ -13,11 +13,8 @@ BEGIN {
 
     # Makes testing easier.
     $ENV{PERLIO} = 'stdio' if exists $ENV{PERLIO} && $ENV{PERLIO} eq '';
-    if (exists $ENV{PERLIO} && $ENV{PERLIO} !~ /^(stdio|perlio|mmap)$/) {
-       # We are not prepared for anything else.
-       print "1..0 # PERLIO='$ENV{PERLIO}' unknown\n";
-       exit 0;
-    }
+    skip_all("PERLIO='$ENV{PERLIO}' unknown")
+       if exists $ENV{PERLIO} && $ENV{PERLIO} !~ /^(stdio|perlio|mmap)$/;
     $PERLIO = exists $ENV{PERLIO} ? $ENV{PERLIO} : "(undef)";
 }
 
index a76c64d..315de90 100644 (file)
@@ -1,16 +1,14 @@
 #!./perl
 
 BEGIN {
-    if ($^O eq 'VMS') {
-        print "1..0 # Skip on VMS -- too picky about line endings for record-oriented pipes\n";
-        exit;
-    }
     chdir 't' if -d 't';
     @INC = '../lib';
+    require './test.pl';
+    skip_all("VMS too picky about line endings for record-oriented pipes")
+       if $^O eq 'VMS';
 }
 
 use strict;
-require './test.pl';
 
 my $Perl = which_perl();
 
index d1b6e5b..3c40394 100644 (file)
@@ -5,19 +5,15 @@
 BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
-    require Config; import Config;
-    unless ($Config{'d_fork'} or $Config{'d_pseudofork'}) {
-       print "1..0 # Skip: no fork\n";
-       exit 0;
-    }
     $ENV{PERL5LIB} = "../lib";
     require './test.pl';
+    require Config;
+    skip_all('no fork')
+       unless ($Config::Config{d_fork} or $Config::Config{d_pseudofork});
 }
 
-if ($^O eq 'mpeix') {
-    print "1..0 # Skip: fork/status problems on MPE/iX\n";
-    exit 0;
-}
+skip_all('fork/status problems on MPE/iX')
+    if $^O eq 'mpeix';
 
 $|=1;
 
index aac3d34..f06d192 100644 (file)
@@ -5,13 +5,11 @@
 BEGIN {
        chdir 't' if -d 't';
        @INC = '../lib';
-       # Don't bother if there are no quad offsets.
-       require Config; import Config;
-       if ($Config{lseeksize} < 8) {
-               print "1..0 # Skip: no 64-bit file offsets\n";
-               exit(0);
-       }
        require './test.pl';
+       require Config;
+       # Don't bother if there are no quad offsets.
+       skip_all('no 64-bit file offsets')
+               if $Config::Config{lseeksize} < 8;
 }
 
 use strict;
index a5747cb..e080245 100644 (file)
@@ -3,14 +3,11 @@
 # This script is written intentionally in UTF-8
 
 BEGIN {
-    if (ord("A") == 193) {
-        print "1..0 # Skip: EBCDIC\n";
-        exit 0;
-    }
     $| = 1;
 
     require './test.pl';
     skip_all_if_miniperl("no dynamic loading on miniperl, no re");
+    skip_all('EBCDIC') if $::IS_EBCDIC;
 }
 
 use strict;