[1182] If there is only one test running, swap back to the single test output (with

Nicholas Clark nick at ccl4.org
Wed Aug 27 21:28:14 UTC 2008


On Wed, Aug 27, 2008 at 05:15:49PM -0400, Andy Armstrong wrote:
> On 27 Aug 2008, at 17:07, Nicholas Clark wrote:
> >> Log Message:
> >> -----------
> >> If there is only one test running, swap back to the single test  
> >> output (with
> >> the test name), so that the identity of the slowcoach that we're  
> >> waiting for
> >> is clear.
> >
> > I hope we like this. Until now I've been frustrated wondering "what  
> > am I
> > waiting for?"
> 
> Yeah, very likey thanks.
> 
> >
> >
> >> -    if (@$active) {
> >> +    if (@$active > 1) {
> >>         $self->_output_ruler;
> >> -    } else {
> >> +    } elsif (@$active < 1) {
> >>         # $self->formatter->_output("\n");
> >>         delete $shared{$formatter};
> >
> > This produces a 0-1 second blank hiatus between the multi-test ruler  
> > going
> > and the first line of "test_name .... count/total" output, but I  
> > couldn't
> > figure out an alternative clean way of doing it, that also didn't  
> > leave
> > garbage on screen from the ruler.
> 
> 
> Looks lovely to me :)

Not quite perfect, and I'm not sure how to fix it. The core tests flip to
showing op/regexp_qr_embed_thr.t chugging its way through, then flips back
to the parallel ruler when it completes, and the library & extension tests
start running in parallel again. But there's a bit of visual clutter left:

lib/proxy_constant_subs.t ........................................ ok   
uni/upper.t ...................................................... ok   
op/regexp_qr_embed_thr.t ......................................... ok   1353 
../ext/B/t/b.t ................................................... ok   
../ext/Compress/Raw/Zlib/t/01version.t ........................... ok   
../ext/Compress/Zlib/t/01version.t ............................... ok   


It's because ParallelSession's line clearer is used:

sub _clear_line {
    my $self = shift;
    $self->formatter->_output( "\r" . ( ' ' x WIDTH ) . "\r" );
}

where

use constant WIDTH => 72;    # Because Eric says

but Session's output is wider. Really at this point we need this line clearer
from Session.pm:

            if ($show_count) {
                my $spaces = ' ' x
                  length( '.' . $pretty . $plan . $parser->tests_run );
                $formatter->$output("\r$spaces\r$pretty");
            }

but it's buried in a closer and I'm not sure of a good clean way to make it
callable.

Nicholas Clark


More information about the tapx-dev mailing list