summaryrefslogtreecommitdiff
path: root/ext/Cwd
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2009-08-28 00:44:15 +0100
committerNicholas Clark <nick@ccl4.org>2009-08-28 00:44:15 +0100
commit2adbc9b6919cad1240a834325b355e9b2d5efd67 (patch)
treea8ca75ac9ed7b8284a533b3f24c8407110d0c546 /ext/Cwd
parentd418880282b996e8cb066a570596b473fa7900da (diff)
downloadperl-2adbc9b6919cad1240a834325b355e9b2d5efd67.tar.gz
Make extensions in ext run their tests from the extension's own directory.
Inspired by, and in parts borrows from, Schwern's branch on github, but takes a slightly different approach in places. Not quite perfect yet - ext/File-Glob still runs from t, at least one FIXME needs fixing, and the changes to dual-life modules' tests need to be filtered back upstream, and possibly modified to suit their respective authors. But it works.
Diffstat (limited to 'ext/Cwd')
-rw-r--r--ext/Cwd/t/cwd.t10
-rw-r--r--ext/Cwd/t/taint.t8
-rw-r--r--ext/Cwd/t/win32.t6
3 files changed, 4 insertions, 20 deletions
diff --git a/ext/Cwd/t/cwd.t b/ext/Cwd/t/cwd.t
index 8e86c4dece..bab3dc372b 100644
--- a/ext/Cwd/t/cwd.t
+++ b/ext/Cwd/t/cwd.t
@@ -1,15 +1,11 @@
#!./perl -w
-BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't';
- @INC = '../lib';
- }
-}
+use strict;
+
use Cwd;
+
chdir 't';
-use strict;
use Config;
use File::Spec;
use File::Path;
diff --git a/ext/Cwd/t/taint.t b/ext/Cwd/t/taint.t
index c92dbe3eb1..60cbfebc41 100644
--- a/ext/Cwd/t/taint.t
+++ b/ext/Cwd/t/taint.t
@@ -3,14 +3,8 @@
use strict;
-BEGIN {
- if ($ENV{PERL_CORE}) {
- chdir 't';
- @INC = '../lib';
- }
-}
use Cwd;
-chdir 't';
+chdir 't' unless $ENV{PERL_CORE};
use File::Spec;
use lib File::Spec->catdir('t', 'lib');
diff --git a/ext/Cwd/t/win32.t b/ext/Cwd/t/win32.t
index 2934c81671..3fa5cb86ab 100644
--- a/ext/Cwd/t/win32.t
+++ b/ext/Cwd/t/win32.t
@@ -1,11 +1,5 @@
#!./perl
-BEGIN {
- if ($ENV{PERL_CORE}) {
- @INC = '../lib';
- }
-}
-
use File::Spec;
use lib File::Spec->catdir('t', 'lib');
use Test::More;