1
Fork 0

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
```
This commit is contained in:
Felix S. Klock II 2018-04-11 17:18:22 +02:00
parent 5589550356
commit ae6a9d4ba4
2 changed files with 6 additions and 2 deletions

View file

@ -101,7 +101,7 @@ pub enum CompareMode {
}
impl CompareMode {
fn to_str(&self) -> &'static str {
pub(crate) fn to_str(&self) -> &'static str {
match *self {
CompareMode::Nll => "nll"
}

View file

@ -728,7 +728,11 @@ pub fn make_test_name(config: &Config, testpaths: &TestPaths) -> test::TestName
let path = PathBuf::from(config.src_base.file_name().unwrap())
.join(&testpaths.relative_dir)
.join(&testpaths.file.file_name().unwrap());
test::DynTestName(format!("[{}] {}", config.mode, path.display()))
let mode_suffix = match config.compare_mode {
Some(ref mode) => format!(" ({})", mode.to_str()),
None => format!(""),
};
test::DynTestName(format!("[{}{}] {}", config.mode, mode_suffix, path.display()))
}
pub fn make_test_closure(config: &Config, testpaths: &TestPaths) -> test::TestFn {