ExtUtils::MakeMaker 6.55_02
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / t / MM_Win32.t
index bc7f68d..c779da2 100644 (file)
@@ -16,7 +16,7 @@ use Test::More;
 
 BEGIN {
        if ($^O =~ /MSWin32/i) {
-               plan tests => 42;
+               plan tests => 49;
        } else {
                plan skip_all => 'This is not Win32';
        }
@@ -37,6 +37,7 @@ my $MM = bless {
                 MAKEFILE => 'Makefile',
                 RM_RF   => 'rm -rf',
                 MV      => 'mv',
+                MAKE    => $Config{make}
                }, 'MM';
 
 
@@ -163,27 +164,15 @@ delete $ENV{PATHEXT} unless $had_pathext;
 }
 
 # 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)', 
@@ -245,6 +234,37 @@ EOSCRIPT
 }
 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