Skip to content

Commit

Permalink
show which test the rmake process belongs to
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Dec 15, 2024
1 parent da535b9 commit 056eb75
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::borrow::Cow;
use std::collections::{HashMap, HashSet};
use std::ffi::OsString;
use std::ffi::{OsStr, OsString};
use std::fs::{self, File, create_dir_all};
use std::hash::{DefaultHasher, Hash, Hasher};
use std::io::prelude::*;
Expand Down Expand Up @@ -1836,7 +1836,20 @@ impl<'test> TestCx<'test> {
return;
}

let proc_name = Path::new(proc_name).file_name().unwrap().to_string_lossy();
let path = Path::new(proc_name);
let proc_name = if path.file_stem().is_some_and(|p| p == "rmake") {
OsString::from_iter(
path.parent()
.unwrap()
.file_name()
.into_iter()
.chain(Some(OsStr::new("/")))
.chain(path.file_name()),
)
} else {
path.file_name().unwrap().into()
};
let proc_name = proc_name.to_string_lossy();
println!("------{proc_name} stdout------------------------------");
println!("{}", out);
println!("------{proc_name} stderr------------------------------");
Expand Down

0 comments on commit 056eb75

Please sign in to comment.