Skip to content

Commit ae6a9d4

Browse files
committed
Change output of compiletest to include the compare-mode when present.
E.g. when running with `--compare-mode=nll`, then each test line will look like e.g.: ``` test [ui (nll)] ui/issue-10969.rs ... ok ```
1 parent 5589550 commit ae6a9d4

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/tools/compiletest/src/common.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ pub enum CompareMode {
101101
}
102102

103103
impl CompareMode {
104-
fn to_str(&self) -> &'static str {
104+
pub(crate) fn to_str(&self) -> &'static str {
105105
match *self {
106106
CompareMode::Nll => "nll"
107107
}

src/tools/compiletest/src/main.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,11 @@ pub fn make_test_name(config: &Config, testpaths: &TestPaths) -> test::TestName
728728
let path = PathBuf::from(config.src_base.file_name().unwrap())
729729
.join(&testpaths.relative_dir)
730730
.join(&testpaths.file.file_name().unwrap());
731-
test::DynTestName(format!("[{}] {}", config.mode, path.display()))
731+
let mode_suffix = match config.compare_mode {
732+
Some(ref mode) => format!(" ({})", mode.to_str()),
733+
None => format!(""),
734+
};
735+
test::DynTestName(format!("[{}{}] {}", config.mode, mode_suffix, path.display()))
732736
}
733737

734738
pub fn make_test_closure(config: &Config, testpaths: &TestPaths) -> test::TestFn {

0 commit comments

Comments
 (0)