BEGIN {
if ($^O =~ /MSWin32/i) {
- plan tests => 42;
+ plan tests => 49;
} else {
plan skip_all => 'This is not Win32';
}
MAKEFILE => 'Makefile',
RM_RF => 'rm -rf',
MV => 'mv',
+ MAKE => $Config{make}
}, 'MM';
{
my $my_perl = $1 if $^X =~ /(.*)/; # are we in -T or -t?
my( $perl, $path ) = fileparse( $my_perl );
- like( $MM->find_perl( $], [ $perl ], [ $path ], 0 ), \r
+ like( $MM->find_perl( $], [ $perl ], [ $path ], 0 ),
qr/^\Q$my_perl\E$/i, 'find_perl() finds this perl' );
}
# init_others(): check if all keys are created and set?
# qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP TEST_F LD AR LDLOADLIBS DEV_NUL )
{
- my $mm_w32 = bless( {}, 'MM' );
+ my $mm_w32 = bless( { BASEEXT => 'Foo' }, 'MM' );
$mm_w32->init_others();
my @keys = qw( TOUCH CHMOD CP RM_F RM_RF MV NOOP
TEST_F LD AR LDLOADLIBS DEV_NULL );
}
# path()
-my $had_path = exists $ENV{PATH};
{
- my @path_eg = ( qw( . .. ), 'C:\\Program Files' );
- local $ENV{PATH} = join ';', @path_eg;
- ok( eq_array( [ $MM->path() ], [ @path_eg ] ),
+ ok( eq_array( [ $MM->path() ], [ File::Spec->path ] ),
'path() [preset]' );
}
-# Bug in Perl. local $ENV{FOO} will not delete key afterwards.
-delete $ENV{PATH} unless $had_path;
# static_lib() should look into that
# dynamic_bs() should look into that
# dynamic_lib() should look into that
-# clean()
-{
- my $clean = $Config{cc} =~ /^gcc/i ? 'dll.base dll.exp' : '*.pdb';
- like( $MM->clean(), qr/^clean ::\s+\Q-$(RM_F) $clean\E\s+$/m,
- 'clean() Makefile target' );
-}
-
# init_linker
{
my $libperl = File::Spec->catfile('$(PERL_INC)',
}
unlink "${script_name}$script_ext" if -f "${script_name}$script_ext";
+# is_make_type()
+{
+ # Check for literal nmake
+ SKIP: {
+ skip("Not using 'nmake'", 2) unless $Config{make} eq 'nmake';
+ ok( $MM->is_make_type('nmake'), '->is_make_type(nmake) true' );
+ ok( ! $MM->is_make_type('dmake'), '->is_make_type(dmake) false' );
+ }
+
+ # Check for literal nmake
+ SKIP: {
+ skip("Not using /nmake/", 2) unless $Config{make} =~ /nmake/;
+ ok( $MM->is_make_type('nmake'), '->is_make_type(nmake) true' );
+ ok( ! $MM->is_make_type('dmake'), '->is_make_type(dmake) false' );
+ }
+
+ # Check for literal dmake
+ SKIP: {
+ skip("Not using 'dmake'", 2) unless $Config{make} eq 'dmake';
+ ok( $MM->is_make_type('dmake'), '->is_make_type(dmake) true' );
+ ok( ! $MM->is_make_type('nmake'), '->is_make_type(nmake) false' );
+ }
+
+ # Check for literal dmake
+ SKIP: {
+ skip("Not using /dmake/", 2) unless $Config{make} =~ /dmake/;
+ ok( $MM->is_make_type('dmake'), '->is_make_type(dmake) true' );
+ ok( ! $MM->is_make_type('nmake'), '->is_make_type(nmake) false' );
+ }
+
+}
# xs_o() should look into that
# top_targets() should look into that