4 if( $ENV{PERL_CORE} ) {
18 if ($^O =~ /cygwin/i) {
21 plan skip_all => "This is not cygwin";
29 use_ok( 'ExtUtils::MM_Cygwin' );
32 my $path = File::Spec->canonpath('/a/../../c');
33 is( MM->canonpath('/a/../../c'), $path,
34 'canonpath() method should work just like the one in File::Spec' );
36 # test cflags, with the fake package below
38 CFLAGS => 'fakeflags',
42 # with CFLAGS set, it should be returned
43 is( $MM->cflags(), 'fakeflags',
44 'cflags() should return CFLAGS member data, if set' );
48 # ExtUtils::MM_Cygwin::cflags() calls this, fake the output
50 local $SIG{__WARN__} = sub {
51 warn @_ unless $_[0] =~ /^Subroutine .* redefined/;
53 *ExtUtils::MM_Unix::cflags = sub { return $_[1] };
56 # respects the config setting, should ignore whitespace around equal sign
57 my $ccflags = $Config{useshrplib} eq 'true' ? ' -DUSEIMPORTLIB' : '';
59 local $MM->{NEEDS_LINKING} = 1;
66 like( $MM->{CFLAGS}, qr/OPTIMIZE = opt/, '... should set OPTIMIZE' );
67 like( $MM->{CFLAGS}, qr/PERLTYPE = pt/, '... should set PERLTYPE' );
68 like( $MM->{CFLAGS}, qr/CCFLAGS = $ccflags/, '... should set CCFLAGS' );
75 MAKEFILE => 'Makefile',
77 unlike( $MM->manifypods(), qr/foo/,
78 'manifypods() should return without PODS values set' );
80 $MM->{MAN3PODS} = { foo => 'foo.1' };
81 my $res = $MM->manifypods();
82 like( $res, qr/pure_all.*foo.*foo.1/s, '... should add MAN3PODS targets' );
87 my $libperl = $Config{libperl} || 'libperl.a';
88 $libperl =~ s/\.a/.dll.a/ if $] >= 5.006002;
89 $libperl = "\$(PERL_INC)/$libperl";
95 is( $MM->{PERL_ARCHIVE}, $libperl, 'PERL_ARCHIVE' );
96 is( $MM->{PERL_ARCHIVE_AFTER}, $after, 'PERL_ARCHIVE_AFTER' );
97 is( $MM->{EXPORT_LIST}, $export, 'EXPORT_LIST' );
105 bless(\(my $scalar), $_[0]);