11 if ($^O =~ /cygwin/i) {
14 plan skip_all => 'Test irrelevant outside of Cygwin';
21 # MM package faked up by messy MI entanglement
22 @MM::ISA = qw( ExtUtils::MM_Unix ExtUtils::Liblist::Kid ExtUtils::MakeMaker );
24 use_ok( 'ExtUtils::MM_Cygwin' );
27 my $path = File::Spec->canonpath('/a/../../c');
28 is( MM->canonpath('/a/../../c'), $path,
29 'canonpath() method should work just like the one in File::Spec' );
31 # test cflags, with the fake package below
33 CFLAGS => 'fakeflags',
37 # with CFLAGS set, it should be returned
38 is( $args->cflags(), 'fakeflags',
39 'cflags() should return CFLAGS member data, if set' );
41 delete $args->{CFLAGS};
43 # ExtUtils::MM_Cygwin::cflags() calls this, fake the output
44 *ExtUtils::MM_Unix::cflags = sub { return $_[1] };
46 # respects the config setting, should ignore whitespace around equal sign
47 my $ccflags = $Config{useshrplib} eq 'true' ? ' -DUSEIMPORTLIB' : '';
48 $args->cflags(<<FLAGS);
55 like( $args->{CFLAGS}, qr/OPTIMIZE = opt/, '... should set OPTIMIZE' );
56 like( $args->{CFLAGS}, qr/PERLTYPE = pt/, '... should set PERLTYPE' );
57 like( $args->{CFLAGS}, qr/LARGE = lg/, '... should set LARGE' );
58 like( $args->{CFLAGS}, qr/SPLIT = split/, '... should set SPLIT' );
59 like( $args->{CFLAGS}, qr/CCFLAGS = $ccflags/, '... should set CCFLAGS' );
67 like( $args->manifypods(), qr/pure_all\n\tnoecho/,
68 'manifypods() should return without PODS values set' );
70 $args->{MAN3PODS} = { foo => 1 };
71 my $out = tie *STDOUT, 'FakeOut';
72 my $res = $args->manifypods();
73 like( $$out, qr/could not locate your pod2man/,
74 '... should warn if pod2man cannot be located' );
75 like( $res, qr/POD2MAN_EXE = -S pod2man/,
76 '... should use default pod2man target' );
77 like( $res, qr/pure_all.+foo/, '... should add MAN3PODS targets' );
79 $args->{PERL_SRC} = File::Spec->updir;
80 $args->{MAN1PODS} = { bar => 1 };
82 $res = $args->manifypods();
83 is( $$out, '', '... should not warn if PERL_SRC provided' );
84 like( $res, qr/bar \\\n\t1 \\\n\tfoo/, '... should join MAN1PODS and MAN3PODS');
87 my $libperl = $Config{libperl} || 'libperl.a';
88 is( $args->perl_archive(), "\$(PERL_INC)/$libperl",
89 'perl_archive() should respect libperl setting' );
91 # test import of $Verbose and &neatvalue
92 can_ok( 'ExtUtils::MM_Cygwin', 'neatvalue' );
93 is( $ExtUtils::MM_Cygwin::Verbose, $ExtUtils::MakeMaker::Verbose,
94 'ExtUtils::MM_Cygwin should import $Verbose from ExtUtils::MakeMaker' );
99 bless(\(my $scalar), $_[0]);