From: "Yitzchak Scott-Thoennes" <sthoenna@efn.org>
Message-ID: <1300.63.226.247.142.
1172479510.squirrel@63.226.247.142>
(Stops Win32* extension tests from being run when the
corresponding extensions haven't been built)
p4raw-id: //depot/perl@30409
######################### We start with some black magic to print on failure.
-BEGIN { $|= 1; print "1..267\n"; }
+BEGIN {
+ $|= 1;
+
+ # when building perl, skip this test if Win32API::File isn't being built
+ if ( $ENV{PERL_CORE} ) {
+ require Config;
+ if ( $Config::Config{extensions} !~ m:(?<!\S)Win32API/File(?!\S): ) {
+ print "1..0 # Skip Win32API::File extension not built\n";
+ exit();
+ }
+ }
+
+ print "1..267\n";
+}
END {print "not ok 1\n" unless $loaded;}
# Win32API::File does an implicit "require Win32", but
#!perl
# vim:syntax=perl:
-BEGIN { $|= 1; print "1..10\n"; }
+BEGIN {
+ $|= 1;
+
+ # when building perl, skip this test if Win32API::File isn't being built
+ if ( $ENV{PERL_CORE} ) {
+ require Config;
+ if ( $Config::Config{extensions} !~ m:(?<!\S)Win32API/File(?!\S): ) {
+ print "1..0 # Skip Win32API::File extension not built\n";
+ exit();
+ }
+ }
+
+ print "1..10\n";
+}
END { print "not ok 1\n" unless $main::loaded; }
use strict;
#!perl
-use Test;
-BEGIN { plan tests => 1 };
-use Win32CORE;
-ok(1);
+use Test::More;
+BEGIN {
+ if ( $ENV{PERL_CORE} ) {
+ require Config;
+ if ( $Config::Config{extensions} !~ /(?<!\S)Win32CORE(?!\S)/ ) {
+ plan skip_all => "Win32CORE extension not built";
+ exit();
+ }
+ }
+
+ plan tests => 1;
+};
+use_ok( "Win32CORE" );