4 @INC = qw(../win32 ../lib);
6 skip_all('FindExt not portable')
12 # Test that Win32/FindExt.pm is consistent with Configure in determining the
13 # types of extensions.
14 # It's not possible to check the list of built dynamic extensions, as that
15 # varies based on which headers are present, and which options ./Configure was
18 if ($^O eq "MSWin32" && !defined $ENV{PERL_STATIC_EXT}) {
19 skip_all "PERL_STATIC_EXT must be set to the list of static extensions";
22 unless (defined $Config{usedl}) {
23 skip_all "FindExt just plain broken for static perl.";
29 FindExt::apply_config(\%Config);
30 FindExt::scan_ext('../cpan');
31 FindExt::scan_ext('../dist');
32 FindExt::scan_ext('../ext');
33 FindExt::set_static_extensions(split ' ', $ENV{PERL_STATIC_EXT}) if $^O eq "MSWin32";
34 FindExt::set_static_extensions(split ' ', $Config{static_ext}) unless $^O eq "MSWin32";
36 # Config.pm and FindExt.pm make different choices about what should be built
40 foreach my $type (qw(static dynamic nonxs)) {
41 push @found_built, eval "FindExt::${type}_ext()";
42 push @config_built, split ' ', $Config{"${type}_ext"};
45 @config_built = sort @config_built;
46 @found_built = sort @found_built;
48 foreach (['static_ext',
49 [FindExt::static_ext()], $Config{static_ext}],
51 [FindExt::nonxs_ext()], $Config{nonxs_ext}],
53 [FindExt::known_extensions()], $Config{known_extensions}],
54 ['"config" dynamic + static + nonxs',
55 \@config_built, $Config{extensions}],
56 ['"found" dynamic + static + nonxs',
57 \@found_built, join " ", FindExt::extensions()],
59 my ($type, $found, $config) = @$_;
60 my @config = sort split ' ', $config;
61 is (scalar @$found, scalar @config,
62 "We find the same number of $type");
63 is ("@$found", "@config", "We find the same list of $type");