summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-12-12 21:38:52 -0700
committerYves Orton <demerphq@gmail.com>2022-12-18 18:56:09 +0100
commitc7f8bf87c7839fa664afa2b32be8f44b499b0763 (patch)
tree0ba4bda7e70ee0da2bf5126e8b391575b49b1b3f /t
parent8bb94d74fa4c2d935e37956ea7d2c837d7c91d42 (diff)
downloadperl-c7f8bf87c7839fa664afa2b32be8f44b499b0763.tar.gz
harness: Assign names to $_
These are clearer to read, espectially in largish loops.
Diffstat (limited to 't')
-rw-r--r--t/harness20
1 files changed, 10 insertions, 10 deletions
diff --git a/t/harness b/t/harness
index 6cc49f82ca..700d3d6870 100644
--- a/t/harness
+++ b/t/harness
@@ -180,18 +180,18 @@ if (@ARGV) {
my %all_dirs;
# Preprocess the list of tests
- for (@last) {
+ for my $file (@last) {
if ($^O eq 'MSWin32') {
- s,\\,/,g; # canonicalize path
+ $file =~ s,\\,/,g; # canonicalize path
};
# Keep a list of the distinct directory names, and another list of
# those which contain a file whose name begins with a 0
- if ( m! \A (?: \.\. / )?
+ if ($file =~ m! \A (?: \.\. / )?
( .*? ) # $1 is the directory path name
- /
+ /
( [^/]* \. (?: t | pl ) ) # $2 is the test name
- \z !x)
+ \z !x)
{
my $path = $1;
my $name = $2;
@@ -224,17 +224,17 @@ if (@ARGV) {
undef %all_dirs;
undef %serials;
- for (@last) {
+ for my $file (@last) {
# Treat every file in each non-serial directory as its own
# "directory", so that it can be executed in parallel
- m! \A ( (?: \.\. / )? (?: $non_serials )
+ $file =~ m! \A ( (?: \.\. / )? (?: $non_serials )
/ [^/]+ \.t \z | .* [/] ) !x
- or die "'$_'";
- push @{$dir{$1}}, $_;
+ or die "'$file'";
+ push @{$dir{$1}}, $file;
# This file contributes time to the total needed for the directory
# as a whole
- $total_time{$1} += $times{$_} || 0;
+ $total_time{$1} += $times{$file} || 0;
}
#print STDERR __LINE__, join "\n", sort sort_by_execution_order keys %dir