This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
better perl version output in corelist-diff
[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
57ad57e0 12FindExt::scan_ext('../cpan');
0598b5ab
NC
13FindExt::scan_ext('../ext');
14
15# Config.pm and FindExt.pm make different choices about what should be built
16my @config_built;
17my @found_built;
18{
19 foreach my $type (qw(static dynamic nonxs)) {
20 push @found_built, eval "FindExt::${type}_ext()";
21 push @config_built, split ' ', $Config{"${type}_ext"};
22 }
23}
24@config_built = sort @config_built;
25@found_built = sort @found_built;
26
27foreach (['static_ext',
28 [FindExt::static_ext()], $Config{static_ext}],
29 ['nonxs_ext',
30 [FindExt::nonxs_ext()], $Config{nonxs_ext}],
31 ['known_extensions',
32 [FindExt::known_extensions()], $Config{known_extensions}],
33 ['"config" dynamic + static + nonxs',
34 \@config_built, $Config{extensions}],
35 ['"found" dynamic + static + nonxs',
36 \@found_built, join " ", FindExt::extensions()],
37 ) {
38 my ($type, $found, $config) = @$_;
39 my @config = sort split ' ', $config;
40 is (scalar @$found, scalar @config,
41 "We find the same number of $type");
42 is_deeply($found, \@config, "We find the same");
43}