Update of /cvsroot/module-build/Module-Build/t
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4114/t
Modified Files:
destinations.t
Log Message:
Add defaults for prefixification to use in case the install location is
outside the config prefix.
_catprefix() was busted because splitpath considers the last thing on a
path to be a file in Unix. It can't distinguish between directories and
files. We just assume its a directory.
Throughly test prefixifcation defaults.
Index: destinations.t
===================================================================
RCS file: /cvsroot/module-build/Module-Build/t/destinations.t,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -d -r1.14 -r1.15
--- destinations.t 21 Jun 2005 22:49:30 -0000 1.14
+++ destinations.t 21 Jun 2005 23:16:19 -0000 1.15
@@ -13,7 +13,7 @@
}
-use Test::More tests => 55;
+use Test::More tests => 67;
use_ok 'Module::Build';
@@ -116,14 +116,24 @@
# Try a config setting which would result in installation locations outside
# the prefix. Ensure it doesn't.
{
- my %test_config = (
- lib => '/foo/bar/lib',
- arch => '/foo/bar/arch',
- bin => '/wiffle/bin',
- script => '/yarrow/script',
- bindoc => '/this/moof/bindoc',
- libdoc => '/libdoc',
- );
+ # Get the prefix defaults
+ my $defaults = $M->_prefix_defaults;
+ $defaults = $defaults->{site};
+
+ # Create a configuration involving weird paths that are outside of
+ # the configured prefix.
+ my @prefixes = (
+ [qw(foo bar)],
+ [qw(biz)],
+ [],
+ );
+
+ my %test_config;
+ foreach my $type (keys %$defaults) {
+ my $prefix = shift @prefixes || [qw(foo bar)];
+ $test_config{$type} = catdir(File::Spec->rootdir, @$prefix,
+ $defaults->{$type});
+ }
# Poke at the innards of MB to change the default install locations.
while( my($key, $path) = each %test_config ) {
|