diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-04-11 17:18:22 +0200 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2018-04-18 14:47:28 +0200 |
| commit | ae6a9d4ba484f8f5bb9cbebf6da6d179bef519e1 (patch) | |
| tree | bbfa19dcdbb6df773adbe977a73477d64bb64465 /src/tools | |
| parent | 558955035688162ddde287eff62f0becbbe5f36b (diff) | |
| download | rust-ae6a9d4ba484f8f5bb9cbebf6da6d179bef519e1.tar.gz rust-ae6a9d4ba484f8f5bb9cbebf6da6d179bef519e1.zip | |
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 ```
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/compiletest/src/common.rs | 2 | ||||
| -rw-r--r-- | src/tools/compiletest/src/main.rs | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index 41fc67a66f4..365b47447f2 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -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" } diff --git a/src/tools/compiletest/src/main.rs b/src/tools/compiletest/src/main.rs index ae4f4aa4046..f61ab7bae45 100644 --- a/src/tools/compiletest/src/main.rs +++ b/src/tools/compiletest/src/main.rs @@ -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 { |
