From 014b2acac36a45e537d35fb840e9ef4ebc2577c1 Mon Sep 17 00:00:00 2001 From: Ed J Date: Wed, 10 Jan 2024 21:57:20 +0000 Subject: [PATCH] keep split tests but simplify with prefix not dir --- MANIFEST | 22 ++++---- Makefile.PL | 52 +++---------------- t/{primitive/append.t => primitive-append.t} | 0 t/{primitive/clip.t => primitive-clip.t} | 0 .../interpolate.t => primitive-interpolate.t} | 0 .../matmult.t => primitive-matmult.t} | 0 t/{primitive/misc.t => primitive-misc.t} | 0 t/{primitive/random.t => primitive-random.t} | 0 .../selector.t => primitive-selector.t} | 0 t/{primitive/setops.t => primitive-setops.t} | 0 t/{primitive/stats.t => primitive-stats.t} | 0 t/{primitive/vector.t => primitive-vector.t} | 0 .../vsearch.t => primitive-vsearch.t} | 0 13 files changed, 17 insertions(+), 57 deletions(-) rename t/{primitive/append.t => primitive-append.t} (100%) rename t/{primitive/clip.t => primitive-clip.t} (100%) rename t/{primitive/interpolate.t => primitive-interpolate.t} (100%) rename t/{primitive/matmult.t => primitive-matmult.t} (100%) rename t/{primitive/misc.t => primitive-misc.t} (100%) rename t/{primitive/random.t => primitive-random.t} (100%) rename t/{primitive/selector.t => primitive-selector.t} (100%) rename t/{primitive/setops.t => primitive-setops.t} (100%) rename t/{primitive/stats.t => primitive-stats.t} (100%) rename t/{primitive/vector.t => primitive-vector.t} (100%) rename t/{primitive/vsearch.t => primitive-vsearch.t} (100%) diff --git a/MANIFEST b/MANIFEST index 08711bb74..f8ae50882 100644 --- a/MANIFEST +++ b/MANIFEST @@ -720,17 +720,17 @@ t/pdl_from_string.t t/pdlchar.t t/pp_croaking.t t/pp_line_numbers.t -t/primitive/append.t -t/primitive/clip.t -t/primitive/interpolate.t -t/primitive/matmult.t -t/primitive/misc.t -t/primitive/random.t -t/primitive/selector.t -t/primitive/setops.t -t/primitive/stats.t -t/primitive/vector.t -t/primitive/vsearch.t +t/primitive-append.t +t/primitive-clip.t +t/primitive-interpolate.t +t/primitive-matmult.t +t/primitive-misc.t +t/primitive-random.t +t/primitive-selector.t +t/primitive-setops.t +t/primitive-stats.t +t/primitive-vector.t +t/primitive-vsearch.t t/pthread.t t/reduce.t t/scope.t diff --git a/Makefile.PL b/Makefile.PL index 3f0179859..afe652f65 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -6,7 +6,6 @@ use 5.010_000; use ExtUtils::MakeMaker; use ExtUtils::MakeMaker::Config; use File::Spec; -use File::Find; # file globals(!) my ($pdl_f77conf, $seen_f77conf); @@ -77,47 +76,6 @@ sub check_f77conf { return 1; } -# returns a list of globs for nested tests in the passed directory, e.g. -# ( 't/*.t', 't/*/*.t' ) which reflect the actual nesting of tests -sub test_globs { - my $dir = shift; - my @depth; - File::Find::find ( { no_chdir => 1, wanted => sub { /\.t$/ and $depth[ 0+ ( () = m{/}g )] = 1 } } , $dir ); - return map { 't/' . ('*/' x $_ ). '*.t' } 0..$#depth-1 -} - -# return a list of tests associated with the PDL core. tests are searched for in 't', -# and may be a single "$test.t" file, or any files within the t/$test directory. -sub coretests { - my @core = qw( - 01-pptest autoload bad basic bool clump config constructor core croak lvalue - math matrix matrixops nat_complex ops-bitwise ops pdl_from_string - pdlchar pp_croaking pp_line_numbers primitive pthread reduce - slice subclass thread thread_def ufunc - ); - - my @tests; - - for my $test ( @core ) { - - # top level "$test.t" file - my $tfile = File::Spec->catfile('t', $test . '.t'); - - push @tests, $tfile if -f $tfile; - - my $tdir = File::Spec->catfile('t', $test); - if ( -d $tdir ) { - File::Find::find ( { no_chdir => 1, - wanted => sub { /\.t$/ and push @tests, $_; } - }, - $tdir ); - } - } - - return @tests; -} - - sub make_PDL_Config_pm { print "Writing Basic/Core/Config.pm\n"; my $configFile = "Basic/Core/Config.pm"; @@ -283,9 +241,6 @@ my %makefile_hash = ( AUTHOR => 'PerlDL Developers ', ABSTRACT => 'Perl Data Language', BINARY_LOCATION => 'PDL.tar.gz', - - # allow nested test directories - test => { TESTS => join( q{ }, test_globs( './t' ) ) }, ); WriteMakefile(%makefile_hash); @@ -351,7 +306,12 @@ ppm : doctest ppd EOT $text .= "\n" . ::coretarget($self); -my $coretest = join ' ', ::coretests(); +my $coretest = join ' ', map File::Spec->catfile('t', $_.'.t'), qw( + 01-pptest autoload bad basic bool clump config constructor core croak lvalue + math matrix matrixops nat_complex ops-bitwise ops pdl_from_string + pdlchar pp_croaking pp_line_numbers primitive-* pthread reduce + slice subclass thread thread_def ufunc +); $text .= <