This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Tidy perlio_open.t, by using test.pl skip_all* functions where appropriate.
authorNicholas Clark <nick@ccl4.org>
Sun, 6 Mar 2011 22:14:23 +0000 (22:14 +0000)
committerNicholas Clark <nick@ccl4.org>
Sun, 6 Mar 2011 22:48:16 +0000 (22:48 +0000)
This reduces the startup boilerplate code by more than half.

t/io/perlio_open.t

index 5f6a65c..7bd9a70 100644 (file)
@@ -3,20 +3,10 @@
 BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
-    if ($ENV{PERL_CORE_MINITEST}) {
-       print "1..0 # Skip: no Fcntl under miniperl\n";
-       exit 0;
-    }
-    unless (find PerlIO::Layer 'perlio') {
-       print "1..0 # Skip: not perlio\n";
-       exit 0;
-    }
-    use Config;
-    unless (" $Config{extensions} " =~ / Fcntl /) {
-       print "1..0 # Skip: no Fcntl (how did you get this far?)\n";
-       exit 0;
-    }
     require './test.pl';
+    skip_all('not perlio') unless (find PerlIO::Layer 'perlio');
+    skip_all_if_miniperl("no dynamic loading on miniperl, no Fcntl");
+    skip_all_without_extension('Fcntl'); # how did you get this far?
 }
 
 use strict;