Skip tests when PerlIO::scalar and PerlIO::via aren't built
authorNicholas Clark <nick@ccl4.org>
Fri, 18 Jun 2004 13:24:13 +0000 (13:24 +0000)
committerNicholas Clark <nick@ccl4.org>
Fri, 18 Jun 2004 13:24:13 +0000 (13:24 +0000)
p4raw-id: //depot/perl@22956

ext/PerlIO/t/scalar.t
ext/PerlIO/t/via.t

index 01e12b0..a4c4799 100644 (file)
@@ -7,6 +7,11 @@ BEGIN {
        print "1..0 # Skip: not perlio\n";
        exit 0;
     }
+    require Config;
+    if (($Config::Config{'extensions'} !~ /\bPerlIO::scalar\b/) ){
+        print "1..0 # Skip -- Perl configured without PerlIO::scalar module\n";
+        exit 0;
+    }
 }
 
 $| = 1;
index 124efbd..0d819df 100644 (file)
@@ -1,8 +1,5 @@
 #!./perl
 
-use strict;
-use warnings;
-
 BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
@@ -10,8 +7,16 @@ BEGIN {
        print "1..0 # Skip: not perlio\n";
        exit 0;
     }
+    require Config;
+    if (($Config::Config{'extensions'} !~ /\bPerlIO::via\b/) ){
+        print "1..0 # Skip -- Perl configured without PerlIO::via module\n";
+        exit 0;
+    }
 }
 
+use strict;
+use warnings;
+
 my $tmp = "via$$";
 
 use Test::More tests => 18;