4 if( $ENV{PERL_CORE} ) {
17 if ($^O =~ /cygwin/i) {
20 plan skip_all => "This is not cygwin";
28 use_ok( 'ExtUtils::MM_Cygwin' );
31 my $path = File::Spec->canonpath('/a/../../c');
32 is( MM->canonpath('/a/../../c'), $path,
33 'canonpath() method should work just like the one in File::Spec' );
35 # test cflags, with the fake package below
37 CFLAGS => 'fakeflags',
41 # with CFLAGS set, it should be returned
42 is( $args->cflags(), 'fakeflags',
43 'cflags() should return CFLAGS member data, if set' );
45 delete $args->{CFLAGS};
47 # ExtUtils::MM_Cygwin::cflags() calls this, fake the output
49 no warnings 'redefine';
50 sub ExtUtils::MM_Unix::cflags { return $_[1] };
53 # respects the config setting, should ignore whitespace around equal sign
54 my $ccflags = $Config{useshrplib} eq 'true' ? ' -DUSEIMPORTLIB' : '';
55 $args->cflags(<<FLAGS);
62 like( $args->{CFLAGS}, qr/OPTIMIZE = opt/, '... should set OPTIMIZE' );
63 like( $args->{CFLAGS}, qr/PERLTYPE = pt/, '... should set PERLTYPE' );
64 like( $args->{CFLAGS}, qr/LARGE = lg/, '... should set LARGE' );
65 like( $args->{CFLAGS}, qr/SPLIT = split/, '... should set SPLIT' );
66 like( $args->{CFLAGS}, qr/CCFLAGS = $ccflags/, '... should set CCFLAGS' );
73 MAKEFILE => 'Makefile',
75 like( $args->manifypods(), qr/pure_all\n\tnoecho/,
76 'manifypods() should return without PODS values set' );
78 $args->{MAN3PODS} = { foo => 1 };
79 my $out = tie *STDOUT, 'FakeOut';
82 local *MM::perl_script = sub { return };
83 my $res = $args->manifypods();
84 like( $$out, qr/could not locate your pod2man/,
85 '... should warn if pod2man cannot be located' );
86 like( $res, qr/POD2MAN_EXE = -S pod2man/,
87 '... should use default pod2man target' );
88 like( $res, qr/pure_all.+foo/, '... should add MAN3PODS targets' );
92 skip "Only relevent in the core", 2 unless $ENV{PERL_CORE};
93 $args->{PERL_SRC} = File::Spec->updir;
94 $args->{MAN1PODS} = { bar => 1 };
96 $res = $args->manifypods();
97 is( $$out, '', '... should not warn if PERL_SRC provided' );
98 like( $res, qr/bar \\\n\t1 \\\n\tfoo/,
99 '... should join MAN1PODS and MAN3PODS');
103 my $libperl = $Config{libperl} || 'libperl.a';
104 $libperl =~ s/\.a/.dll.a/;
105 is( $args->perl_archive(), "\$(PERL_INC)/$libperl",
106 'perl_archive() should respect libperl setting' );
112 bless(\(my $scalar), $_[0]);