tweak new test suite output

This commit is contained in:
Ralf Jung 2022-05-25 18:12:54 +02:00
parent 0a4279fed9
commit a6b5b0e4ff
2 changed files with 18 additions and 18 deletions

View File

@ -109,13 +109,11 @@ macro_rules! regexes {
fn ui(mode: Mode, path: &str) { fn ui(mode: Mode, path: &str) {
let target = get_target(); let target = get_target();
eprint!("{}", format!("## Running ui tests in {path} against miri for ").green().bold()); let msg = format!(
"## Running ui tests in {path} against miri for {}",
if let Some(target) = &target { target.as_deref().unwrap_or("host")
eprintln!("{target}"); );
} else { eprintln!("{}", msg.green().bold());
eprintln!("host");
}
run_tests(mode, path, target); run_tests(mode, path, target);
} }

View File

@ -56,7 +56,7 @@ pub fn run_tests(config: Config) {
// Some statistics and failure reports. // Some statistics and failure reports.
let failures = Mutex::new(vec![]); let failures = Mutex::new(vec![]);
let succeeded = AtomicUsize::default(); let succeeded = AtomicUsize::default();
let skipped = AtomicUsize::default(); let ignored = AtomicUsize::default();
crossbeam::scope(|s| { crossbeam::scope(|s| {
for _ in 0..std::thread::available_parallelism().unwrap().get() { for _ in 0..std::thread::available_parallelism().unwrap().get() {
@ -74,10 +74,10 @@ pub fn run_tests(config: Config) {
continue; continue;
} }
let comments = Comments::parse(&path); let comments = Comments::parse(&path);
// Skip file if only/skip rules do (not) apply // Ignore file if only/ignore rules do (not) apply
if ignore_file(&comments, &target) { if ignore_file(&comments, &target) {
skipped.fetch_add(1, Ordering::Relaxed); ignored.fetch_add(1, Ordering::Relaxed);
eprintln!("{} .. {}", path.display(), "skipped".yellow()); eprintln!("{} .. {}", path.display(), "ignored".yellow());
continue; continue;
} }
// Run the test for all revisions // Run the test for all revisions
@ -91,7 +91,7 @@ pub fn run_tests(config: Config) {
if !revision.is_empty() { if !revision.is_empty() {
write!(msg, "(revision `{revision}`) ").unwrap(); write!(msg, "(revision `{revision}`) ").unwrap();
} }
write!(msg, " .. ").unwrap(); write!(msg, "... ").unwrap();
if errors.is_empty() { if errors.is_empty() {
eprintln!("{msg}{}", "ok".green()); eprintln!("{msg}{}", "ok".green());
succeeded.fetch_add(1, Ordering::Relaxed); succeeded.fetch_add(1, Ordering::Relaxed);
@ -109,7 +109,7 @@ pub fn run_tests(config: Config) {
// Print all errors in a single thread to show reliable output // Print all errors in a single thread to show reliable output
let failures = failures.into_inner().unwrap(); let failures = failures.into_inner().unwrap();
let succeeded = succeeded.load(Ordering::Relaxed); let succeeded = succeeded.load(Ordering::Relaxed);
let skipped = skipped.load(Ordering::Relaxed); let ignored = ignored.load(Ordering::Relaxed);
if !failures.is_empty() { if !failures.is_empty() {
for (path, miri, revision, errors) in &failures { for (path, miri, revision, errors) in &failures {
eprintln!(); eprintln!();
@ -117,7 +117,7 @@ pub fn run_tests(config: Config) {
if !revision.is_empty() { if !revision.is_empty() {
eprint!(" (revision `{}`)", revision); eprint!(" (revision `{}`)", revision);
} }
eprint!("{}", " FAILED".red()); eprint!(" {}", "FAILED".red());
eprintln!(); eprintln!();
eprintln!("command: {:?}", miri); eprintln!("command: {:?}", miri);
eprintln!(); eprintln!();
@ -153,19 +153,21 @@ pub fn run_tests(config: Config) {
} }
} }
eprintln!( eprintln!(
"{} tests failed, {} tests passed, {} skipped", "{} tests failed, {} tests passed, {} ignored",
failures.len().to_string().red().bold(), failures.len().to_string().red().bold(),
succeeded.to_string().green(), succeeded.to_string().green(),
skipped.to_string().yellow() ignored.to_string().yellow()
); );
std::process::exit(1); std::process::exit(1);
} }
eprintln!(); eprintln!();
eprintln!( eprintln!(
"{} tests passed, {} skipped", "test result: {}. {} tests passed, {} ignored",
"ok".green(),
succeeded.to_string().green(), succeeded.to_string().green(),
skipped.to_string().yellow() ignored.to_string().yellow()
); );
eprintln!();
} }
#[derive(Debug)] #[derive(Debug)]