summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2023-04-16 08:12:51 -0500
committerCraig A. Berry <craigberry@mac.com>2023-04-16 19:45:05 -0500
commitce8b32d4fca69ba96e2f7679c3b9fbdf183a35e0 (patch)
treedd16c04fba3c5b69e61057e5c134a28051bf7994 /t
parenta1b81be29d90bb790a148fcc7e776047c84c7c8a (diff)
downloadperl-ce8b32d4fca69ba96e2f7679c3b9fbdf183a35e0.tar.gz
t/harness: avoid brace expansion
Brace expansion is not available in a POSIX shell, is handled slightly differently by the shells that do support it, and is unlikely to work when the underlying implementation for Perl's glob() function is not a Unix shell. So instead of doing: {foo,bar,baz}/*.t just accumulate the results of simpler glob operations: foo/*.t bar/*.t baz/*.t This also allows us to dispense with the recursive function _extract_tests() and its fancy dispatch based on reference type; we would only ever be calling it with a simple string argument, so we might as well just call glob() directly.
Diffstat (limited to 't')
-rw-r--r--t/harness28
1 files changed, 2 insertions, 26 deletions
diff --git a/t/harness b/t/harness
index a79d5c0d45..6344266d1a 100644
--- a/t/harness
+++ b/t/harness
@@ -116,28 +116,6 @@ if ($ENV{HARNESS_OPTIONS}) {
$jobs ||= 1;
-sub _extract_tests;
-sub _extract_tests {
- # This can probably be done more tersely with a map, but I doubt that it
- # would be as clear
- my @results;
- foreach (@_) {
- my $ref = ref $_;
- if ($ref) {
- if ($ref eq 'ARRAY') {
- push @results, _extract_tests @$_;
- } elsif ($ref eq 'HASH') {
- push @results, _extract_tests values %$_;
- } else {
- die "Unknown reference type $ref";
- }
- } else {
- push @results, glob $_;
- }
- }
- @results;
-}
-
my %total_time;
sub _compute_tests_and_ordering($) {
my @tests = $_[0]->@*;
@@ -367,14 +345,12 @@ if (@ARGV) {
push @$which, 'bigmem' if $ENV{PERL_TEST_MEMORY};
if (@next) {
- my $next = { par => '{' . join (',', @next) . '}/*.t' };
- @next = _extract_tests ($next);
+ @next = map { glob ("$_/*.t") } @next;
push @tests, @next;
push @seq, _compute_tests_and_ordering(\@next)->@*;
}
- my $last = { par => '{' . join (',', @last) . '}/*.t' };
- @last = _extract_tests ($last);
+ @last = map { glob ("$_/*.t") } @last;
my ($non_ext, @ext_from_manifest)=
_tests_from_manifest($Config{extensions}, $Config{known_extensions}, "all");