82dee7de92a0bd35 failed to add ext/lib/Makefile.PL. Oops.
[p5sagit/p5-mst-13.2.git] / ext / ExtUtils-MakeMaker / t / prefixify.t
CommitLineData
e0678a30 1#!/usr/bin/perl -w
2
3BEGIN {
b78fd716 4 unshift @INC, 't/lib';
e0678a30 5}
6
7use strict;
45bc4d3a 8use Test::More;
9
10if( $^O eq 'VMS' ) {
11 plan skip_all => 'prefixify works differently on VMS';
12}
13else {
cb06ebec 14 plan tests => 4;
45bc4d3a 15}
7292dc67 16use ExtUtils::MakeMaker::Config;
e0678a30 17use File::Spec;
18use ExtUtils::MM;
19
a7d1454b 20my $Is_Dosish = $^O =~ /^(dos|MSWin32)$/;
21
e0678a30 22my $mm = bless {}, 'MM';
23
24my $default = File::Spec->catdir(qw(this that));
479d2113 25
e0678a30 26$mm->prefixify('installbin', 'wibble', 'something', $default);
479d2113 27is( $mm->{INSTALLBIN}, $Config{installbin},
28 'prefixify w/defaults');
5c161494 29
479d2113 30$mm->{ARGS}{PREFIX} = 'foo';
31$mm->prefixify('installbin', 'wibble', 'something', $default);
e0678a30 32is( $mm->{INSTALLBIN}, File::Spec->catdir('something', $default),
479d2113 33 'prefixify w/defaults and PREFIX');
45bc4d3a 34
cb06ebec 35$mm->prefixify('installbin', '../wibble', 'something', $default);
36is( $mm->{INSTALLBIN}, File::Spec->catdir('something', $default),
37 'relative paths + PREFIX');
38
a7d1454b 39SKIP: {
40 skip "Test for DOSish prefixification", 1 unless $Is_Dosish;
41
7292dc67 42 $Config{wibble} = 'C:\opt\perl\wibble';
45bc4d3a 43 $mm->prefixify('wibble', 'C:\opt\perl', 'C:\yarrow');
44
45 is( $mm->{WIBBLE}, 'C:\yarrow\wibble', 'prefixify Win32 paths' );
45bc4d3a 46}