-use super::*;
-use super::console::{ConsoleTestState, OutputLocation};
+use std::{
+ io,
+ io::prelude::Write,
+};
+
+use crate::{
+ types::TestDesc,
+ time,
+ test_result::TestResult,
+ types::NamePadding,
+ console::{ConsoleTestState, OutputLocation},
+ bench::fmt_bench_samples,
+};
+use super::OutputFormatter;
+
+// insert a '\n' after 100 tests in quiet mode
+const QUIET_MODE_MAX_COLUMN: usize = 100;
pub(crate) struct TerseFormatter<T> {
out: OutputLocation<T>,
// in order to indicate benchmarks.
// When running benchmarks, terse-mode should still print their name as if
// it is the Pretty formatter.
- if !self.is_multithreaded && desc.name.padding() == PadOnRight {
+ if !self.is_multithreaded && desc.name.padding() == NamePadding::PadOnRight {
self.write_test_name(desc)?;
}
_: &ConsoleTestState,
) -> io::Result<()> {
match *result {
- TrOk => self.write_ok(),
- TrFailed | TrFailedMsg(_) | TrTimedFail => self.write_failed(),
- TrIgnored => self.write_ignored(),
- TrAllowedFail => self.write_allowed_fail(),
- TrBench(ref bs) => {
+ TestResult::TrOk => self.write_ok(),
+ TestResult::TrFailed
+ | TestResult::TrFailedMsg(_)
+ | TestResult::TrTimedFail => self.write_failed(),
+ TestResult::TrIgnored => self.write_ignored(),
+ TestResult::TrAllowedFail => self.write_allowed_fail(),
+ TestResult::TrBench(ref bs) => {
if self.is_multithreaded {
self.write_test_name(desc)?;
}