summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2001-09-22 21:18:43 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2001-09-22 21:18:43 +0000
commit8f78c13df060827662cfa965c08d7e579573d479 (patch)
tree8fb4f32211074614ed67c09734fb19872ca5f4ab /lib
parent0d0c1411f967c385a9f8386bb2e12df519d2a608 (diff)
downloadperl-8f78c13df060827662cfa965c08d7e579573d479.tar.gz
Try ExtUtils::Command.t everywhere, not just on Win32
(as suggested by NI-S). Also allow running it either in t/ or in the main directory. p4raw-id: //depot/perl@12143
Diffstat (limited to 'lib')
-rw-r--r--lib/ExtUtils/Command.t24
1 files changed, 17 insertions, 7 deletions
diff --git a/lib/ExtUtils/Command.t b/lib/ExtUtils/Command.t
index 7596e75588..763ae0cbee 100644
--- a/lib/ExtUtils/Command.t
+++ b/lib/ExtUtils/Command.t
@@ -3,19 +3,21 @@
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
+}
+
+BEGIN {
1 while unlink 'ecmdfile';
# forcibly remove ecmddir/temp2, but don't import mkpath
use File::Path ();
File::Path::rmtree( 'ecmddir' );
}
-use Test::More tests => 21;
-use File::Spec;
-
-SKIP: {
- skip( 'ExtUtils::Command is a Win32 module', 21 )
- unless $^O =~ /Win32/;
+BEGIN {
+ use Test::More tests => 21;
+ use File::Spec;
+}
+{
use vars qw( *CORE::GLOBAL::exit );
# bad neighbor, but test_f() uses exit()
@@ -49,7 +51,15 @@ SKIP: {
# concatenate this file with itself
# be extra careful the regex doesn't match itself
my $out = tie *STDOUT, 'TieOut';
- @ARGV = ($0, $0);
+ my $self = $0;
+ unless (-f $self) {
+ my ($vol, $dirs, $file) = File::Spec->splitpath($self);
+ my @dirs = File::Spec->splitdir($dirs);
+ unshift(@dirs, File::Spec->updir);
+ $dirs = File::Spec->catdir(@dirs);
+ $self = File::Spec->catpath($vol, $dirs, $file);
+ }
+ @ARGV = ($self, $self);
cat();
is( scalar( $$out =~ s/use_ok\( 'ExtUtils::Command'//g), 2,