This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Regenerate headers and fix compilation with threads after last commit
[perl5.git] / win32 / FindExt.t
CommitLineData
0598b5ab
NC
1#!../miniperl -w
2
3BEGIN {
4 @INC = qw(../win32 ../lib);
5}
6use strict;
7
8use Test::More tests => 10;
9use FindExt;
10use Config;
11
12FindExt::scan_ext('../ext');
13
14# Config.pm and FindExt.pm make different choices about what should be built
15my @config_built;
16my @found_built;
17{
18 foreach my $type (qw(static dynamic nonxs)) {
19 push @found_built, eval "FindExt::${type}_ext()";
20 push @config_built, split ' ', $Config{"${type}_ext"};
21 }
22}
23@config_built = sort @config_built;
24@found_built = sort @found_built;
25
26foreach (['static_ext',
27 [FindExt::static_ext()], $Config{static_ext}],
28 ['nonxs_ext',
29 [FindExt::nonxs_ext()], $Config{nonxs_ext}],
30 ['known_extensions',
31 [FindExt::known_extensions()], $Config{known_extensions}],
32 ['"config" dynamic + static + nonxs',
33 \@config_built, $Config{extensions}],
34 ['"found" dynamic + static + nonxs',
35 \@found_built, join " ", FindExt::extensions()],
36 ) {
37 my ($type, $found, $config) = @$_;
38 my @config = sort split ' ', $config;
39 is (scalar @$found, scalar @config,
40 "We find the same number of $type");
41 is_deeply($found, \@config, "We find the same");
42}