about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDylan DPC <99973273+Dylan-DPC@users.noreply.github.com>2022-04-07 01:59:23 +0200
committerGitHub <noreply@github.com>2022-04-07 01:59:23 +0200
commit687e40a959417c9713f04cc88a7ab73672778165 (patch)
tree8c8ed44e9f9f0125ed324d97c1307cd5d267c4ca
parent64e7bf9faed35585e8054f968abae792b1b690ce (diff)
parentb72a7fbcdc6978f73f6e16d0c0cfad8551dc6afe (diff)
downloadrust-687e40a959417c9713f04cc88a7ab73672778165.tar.gz
rust-687e40a959417c9713f04cc88a7ab73672778165.zip
Rollup merge of #95709 - nnethercote:improve-terse-test-output, r=Dylan-DPC
Improve terse test output.

The current terse output gives 112 chars per line, which causes
wraparound for people using 100 char wide terminals, which is very
common.

This commit changes it to be exactly 100 wide, which makes the output
look much nicer.
-rw-r--r--library/test/src/formatters/terse.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/library/test/src/formatters/terse.rs b/library/test/src/formatters/terse.rs
index fb40f86b42e..5dace8baef7 100644
--- a/library/test/src/formatters/terse.rs
+++ b/library/test/src/formatters/terse.rs
@@ -11,8 +11,9 @@ use crate::{
     types::TestDesc,
 };
 
-// insert a '\n' after 100 tests in quiet mode
-const QUIET_MODE_MAX_COLUMN: usize = 100;
+// We insert a '\n' when the output hits 100 columns in quiet mode. 88 test
+// result chars leaves 12 chars for a progress count like " 11704/12853".
+const QUIET_MODE_MAX_COLUMN: usize = 88;
 
 pub(crate) struct TerseFormatter<T> {
     out: OutputLocation<T>,
@@ -65,7 +66,7 @@ impl<T: Write> TerseFormatter<T> {
     ) -> io::Result<()> {
         self.write_pretty(result, color)?;
         if self.test_count % QUIET_MODE_MAX_COLUMN == QUIET_MODE_MAX_COLUMN - 1 {
-            // we insert a new line every 100 dots in order to flush the
+            // We insert a new line regularly in order to flush the
             // screen when dealing with line-buffered output (e.g., piping to
             // `stamp` in the rust CI).
             let out = format!(" {}/{}\n", self.test_count + 1, self.total_test_count);