1#!/usr/bin/perl -w 2 3BEGIN { 4 unshift @INC, 't/lib/'; 5} 6 7use File::Temp qw[tempdir]; 8my $tmpdir = tempdir( DIR => 't', CLEANUP => 1 ); 9chdir $tmpdir; 10 11my $Is_VMS = $^O eq 'VMS'; 12 13use File::Spec; 14 15use Test::More tests => 4; 16 17my $dir = File::Spec->catdir("some", "dir"); 18my @cd_args = ($dir, "command1", "command2"); 19 20{ 21 package Test::MM_Win32; 22 use ExtUtils::MM_Win32; 23 @ISA = qw(ExtUtils::MM_Win32); 24 25 my $mm = bless {}, 'Test::MM_Win32'; 26 27 { 28 local *make = sub { "nmake" }; 29 30 my @dirs = (File::Spec->updir) x 2; 31 my $expected_updir = File::Spec->catdir(@dirs); 32 33 ::is $mm->cd(@cd_args), 34qq{cd $dir 35 command1 36 command2 37 cd $expected_updir}; 38 } 39 40 { 41 local *make = sub { "dmake" }; 42 43 ::is $mm->cd(@cd_args), 44qq{cd $dir && command1 45 cd $dir && command2}; 46 } 47} 48 49{ 50 is +ExtUtils::MM_Unix->cd(@cd_args), 51qq{cd $dir && command1 52 cd $dir && command2}; 53} 54 55SKIP: { 56 skip("VMS' cd requires vmspath which is only on VMS", 1) unless $Is_VMS; 57 58 use ExtUtils::MM_VMS; 59 is +ExtUtils::MM_VMS->cd(@cd_args), 60q{startdir = F$Environment("Default") 61 Set Default [.some.dir] 62 command1 63 command2 64 Set Default 'startdir'}; 65} 66