diff options
author | Nicholas Clark <nick@ccl4.org> | 2009-02-04 10:08:11 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2009-02-04 17:14:06 +0000 |
commit | 0598b5ab3697b872539de6ed6dc1522b873602e1 (patch) | |
tree | 8bae50d36447843ff163b3cec051ff7e87131182 | |
parent | 1f200948c4c45a9bc088451dd377e4ab8733c722 (diff) | |
download | perl-0598b5ab3697b872539de6ed6dc1522b873602e1.tar.gz |
A test for FindExt, not run by make test. (Useful for refactoring FindExt.)
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | win32/FindExt.t | 42 |
2 files changed, 43 insertions, 0 deletions
@@ -4362,6 +4362,7 @@ win32/distclean.bat Remove _ALL_ files not listed here in MANIFEST win32/dl_win32.xs Win32 port win32/fcrypt.c crypt() implementation win32/FindExt.pm Scan for extensions +win32/FindExt.t Test FindExt.pm win32/genmk95.pl Perl code to generate command.com-usable makefile.95 win32/include/arpa/inet.h Win32 port win32/include/dirent.h Win32 port diff --git a/win32/FindExt.t b/win32/FindExt.t new file mode 100644 index 0000000000..cb4de81ed0 --- /dev/null +++ b/win32/FindExt.t @@ -0,0 +1,42 @@ +#!../miniperl -w + +BEGIN { + @INC = qw(../win32 ../lib); +} +use strict; + +use Test::More tests => 10; +use FindExt; +use Config; + +FindExt::scan_ext('../ext'); + +# Config.pm and FindExt.pm make different choices about what should be built +my @config_built; +my @found_built; +{ + foreach my $type (qw(static dynamic nonxs)) { + push @found_built, eval "FindExt::${type}_ext()"; + push @config_built, split ' ', $Config{"${type}_ext"}; + } +} +@config_built = sort @config_built; +@found_built = sort @found_built; + +foreach (['static_ext', + [FindExt::static_ext()], $Config{static_ext}], + ['nonxs_ext', + [FindExt::nonxs_ext()], $Config{nonxs_ext}], + ['known_extensions', + [FindExt::known_extensions()], $Config{known_extensions}], + ['"config" dynamic + static + nonxs', + \@config_built, $Config{extensions}], + ['"found" dynamic + static + nonxs', + \@found_built, join " ", FindExt::extensions()], + ) { + my ($type, $found, $config) = @$_; + my @config = sort split ' ', $config; + is (scalar @$found, scalar @config, + "We find the same number of $type"); + is_deeply($found, \@config, "We find the same"); +} |