Tests in cpan/ should run from their directory, as tests in ext/ already do.
Nicholas Clark [Sat, 26 Sep 2009 14:09:05 +0000 (15:09 +0100)]
t/TEST

diff --git a/t/TEST b/t/TEST
index b1eedc8..094011e 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -34,9 +34,9 @@ my %temp_no_core =
      '../ext/Compress-Raw-Bzip2' => 1,
      '../ext/Compress-Raw-Zlib' => 1,
      '../ext/Devel-PPPort' => 1,
-     '../ext/Getopt-Long' => 1,
+     '../cpan/Getopt-Long' => 1,
      '../ext/IO-Compress' => 1,
-     '../ext/IPC-SysV' => 1,
+     '../cpan/IPC-SysV' => 1,
      '../ext/Math-BigInt' => 1,
      '../ext/Math-BigRat' => 1,
      '../ext/MIME-Base64' => 1,
@@ -194,7 +194,7 @@ sub _scan_test {
     my $dir = $1;
     my $testswitch = $dir_to_switch{$dir};
     if (!defined $testswitch) {
-       if ($test =~ s!^(\.\./ext/[^/]+)/t!t!) {
+       if ($test =~ s!^(\.\./(?:cpan|ext)/[^/]+)/t!t!) {
            $run_dir = $1;
            $return_dir = '../../t';
            $lib = '../../lib';
@@ -345,7 +345,7 @@ sub _tests_from_manifest {
     my $mani = '../MANIFEST';
     if (open(MANI, $mani)) {
        while (<MANI>) {
-           if (m!^(ext/(\S+)/+(?:[^/\s]+\.t|test\.pl)|lib/\S+?(?:\.t|test\.pl))\s!) {
+           if (m!^((?:cpan|ext)/(\S+)/+(?:[^/\s]+\.t|test\.pl)|lib/\S+?(?:\.t|test\.pl))\s!) {
                my $t = $1;
                my $extension = $2;
                if (!$::core || $t =~ m!^lib/[a-z]!) {