Skip to content

Commit b980788

Browse files
osa1Commit Queue
authored andcommitted
[test_runner] Use 'line' progress indicator by default when stdout is not a terminal
When the test runner output is piped to a file, 'compact' progress indicator prints carriage returns to the file. To avoid adding carriage returns to text files, only use 'compact' indicator when stdout is a terminal. Otherwise use 'line' indicator. Change-Id: Ic8ca111059799876caf401d3b040a5d3b5a7c731 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/431861 Reviewed-by: Bob Nystrom <[email protected]> Commit-Queue: Ömer Ağacan <[email protected]>
1 parent 41ac971 commit b980788

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

pkg/test_runner/lib/src/options.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ test options, specifying how tests should be run.''')
180180
..addOption('progress',
181181
abbr: 'p',
182182
allowed: Progress.names,
183-
defaultsTo: Progress.compact.name,
183+
defaultsTo: stdioType(stdout) == StdioType.terminal
184+
? Progress.compact.name
185+
: Progress.line.name,
184186
help: '''Progress indication mode.
185187
186188
Allowed values are:

pkg/test_runner/test/options_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ void main() {
1818
void testDefaults() {
1919
// TODO(rnystrom): Test other options.
2020
var configuration = parseConfiguration([]);
21-
Expect.equals(Progress.compact, configuration.progress);
2221
Expect.equals(NnbdMode.strong, configuration.nnbdMode);
2322
}
2423

0 commit comments

Comments
 (0)