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';
}
# 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