Skip to content

Commit 378a8c5

Browse files
committed
Show all output in interactive mode
1 parent d13157a commit 378a8c5

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

Changes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{{$NEXT}}
22

3+
- Show all output early in interactive mode
4+
35
1.000146 2023-02-20 18:21:51-08:00 America/Los_Angeles
46

57
- Fix infinite hang in bad preload (#240)

lib/Test2/Formatter/Test2.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ use Test2::Util::HashBase qw{
4444
-_file_stats
4545
-job_names
4646
-is_persistent
47+
-interactive
4748
};
4849

4950
sub TAG_WIDTH() { 8 }
@@ -311,7 +312,7 @@ sub write {
311312
$self->{+_BUFFERED} = 1;
312313
}
313314
}
314-
elsif ($depth && $lines && @$lines) {
315+
elsif ($depth && $lines && @$lines && !$self->{+INTERACTIVE}) {
315316
print $io $lines->[0];
316317
$self->{+_BUFFERED} = 1;
317318
}

lib/Test2/Harness/Renderer/Formatter.pm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use Test2::Harness::Util::HashBase qw{
2222
-show_job_launch
2323
-show_job_end
2424
-do_step
25+
-interactive
2526
};
2627

2728
sub init {
@@ -46,13 +47,17 @@ sub init {
4647
$self->{+IO_ERR} = $fh;
4748
}
4849

50+
$self->{+INTERACTIVE} = 1 if $settings->debug->interactive;
51+
$self->{+INTERACTIVE} //= 1 if $ENV{YATH_INTERACTIVE};
52+
4953
$self->{+FORMATTER} = $f_class->new(
5054
io => $self->{+IO},
5155
progress => $self->{+PROGRESS},
5256
handles => [$self->{+IO}, $self->{+IO_ERR}, $self->{+IO}],
5357
verbose => $settings->display->verbose,
5458
color => $settings->display->color,
5559
no_wrap => $settings->display->no_wrap,
60+
interactive => $self->{+INTERACTIVE},
5661
is_persistent => $self->{+COMMAND_CLASS}->group eq 'persist' ? 1 : 0,
5762
);
5863

0 commit comments

Comments
 (0)