summaryrefslogtreecommitdiff
path: root/t/TEST
diff options
context:
space:
mode:
authorMichael G. Schwern <schwern@pobox.com>2001-05-29 09:26:09 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-05-29 15:34:08 +0000
commit24c841bae77f775894f878f3c1a6d03ea2e9ca5f (patch)
treecfddee16b33f334089c6f93284ee289cd21fa3da /t/TEST
parent2857d2f75f0c461bb6df408dedb4450b2e1c89de (diff)
downloadperl-24c841bae77f775894f878f3c1a6d03ea2e9ca5f.tar.gz
Re: [PATCH t/TEST] Allowing deeper test subdirectories
Message-ID: <20010529082609.P675@blackrider.blackstar.co.uk> p4raw-id: //depot/perl@10292
Diffstat (limited to 't/TEST')
-rwxr-xr-xt/TEST28
1 files changed, 25 insertions, 3 deletions
diff --git a/t/TEST b/t/TEST
index 702409e467..3b4ce62059 100755
--- a/t/TEST
+++ b/t/TEST
@@ -44,12 +44,34 @@ $ENV{PERL_DESTRUCT_LEVEL} = 2 unless exists $ENV{PERL_DESTRUCT_LEVEL};
$ENV{EMXSHELL} = 'sh'; # For OS/2
-if ($#ARGV == -1) {
- @ARGV = split(/[ \n]/,
- `echo base/*.t comp/*.t cmd/*.t run/*.t io/*.t; echo op/*.t pragma/*.t lib/*.t pod/*.t`);
+
+# Roll your own File::Find!
+use TestInit;
+use File::Spec;
+my $curdir = File::Spec->curdir;
+my $updir = File::Spec->updir;
+
+sub _find_tests {
+ my($dir) = @_;
+ opendir DIR, $dir || die "Trouble opening $dir: $!";
+ foreach my $f (readdir DIR) {
+ next if $f eq $curdir or $f eq $updir;
+
+ my $fullpath = File::Spec->catdir($dir, $f);
+
+ _find_tests($fullpath) if -d $fullpath;
+ push @ARGV, $fullpath if $f =~ /\.t$/;
+ }
+}
+
+unless (@ARGV) {
+ foreach my $dir (qw(base comp cmd run io op pragma lib pod)) {
+ _find_tests($dir);
+ }
}
# %infinite = ( 'comp/require.t', 1, 'op/bop.t', 1, 'lib/hostname.t', 1 );
+%infinite = ();
if ($deparse) {
_testprogs('deparse', @ARGV);