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