This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/TEST aesthetic tweak suggested by Jarkko
[perl5.git] / t / TEST
diff --git a/t/TEST b/t/TEST
index a302e66..3685c2a 100755 (executable)
--- a/t/TEST
+++ b/t/TEST
@@ -17,7 +17,9 @@ chdir 't' if -f 't/TEST';
 die "You need to run \"make test\" first to set things up.\n"
   unless -e 'perl' or -e 'perl.exe';
 
-#$ENV{PERL_DESTRUCT_LEVEL} = '2';
+# check leakage for embedders
+$ENV{PERL_DESTRUCT_LEVEL} = 2 unless exists $ENV{PERL_DESTRUCT_LEVEL};
+
 $ENV{EMXSHELL} = 'sh';        # For OS/2
 
 if ($#ARGV == -1) {
@@ -46,6 +48,14 @@ EOT
     $total = @tests;
     $files  = 0;
     $totmax = 0;
+    $maxlen = 0;
+    foreach (@tests) {
+       $len = length;
+       $maxlen = $len if $len > $maxlen;
+    }
+    # +3 : we want three dots between the test name and the "ok"
+    # -2 : the .t suffix
+    $dotdotdot = $maxlen + 3 - 2;
     while ($test = shift @tests) {
 
        if ( $infinite{$test} && $type eq 'compile' ) {
@@ -57,7 +67,7 @@ EOT
        }
        $te = $test;
        chop($te);
-       print "$te" . '.' x (18 - length($te));
+       print "$te" . '.' x ($dotdotdot - length($te));
 
        open(SCRIPT,"<$test") or die "Can't run $test.\n";
        $_ = <SCRIPT>;