From d588f9338da3f29f03216e2f2685df5b7ad3d0b3 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Fri, 3 Nov 2017 22:41:15 +0300 Subject: Shorten paths to auxiliary files created by tests --- src/tools/compiletest/src/common.rs | 14 ++++++++++++++ src/tools/compiletest/src/runtest.rs | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src/tools/compiletest') diff --git a/src/tools/compiletest/src/common.rs b/src/tools/compiletest/src/common.rs index aa98f818f40..660462ad419 100644 --- a/src/tools/compiletest/src/common.rs +++ b/src/tools/compiletest/src/common.rs @@ -34,6 +34,20 @@ pub enum Mode { MirOpt, } +impl Mode { + pub fn disambiguator(self) -> &'static str { + // Run-pass and pretty run-pass tests could run concurrently, and if they do, + // they need to keep their output segregated. Same is true for debuginfo tests that + // can be run both on gdb and lldb. + match self { + Pretty => ".pretty", + DebugInfoGdb => ".gdb", + DebugInfoLldb => ".lldb", + _ => "", + } + } +} + impl FromStr for Mode { type Err = (); fn from_str(s: &str) -> Result { diff --git a/src/tools/compiletest/src/runtest.rs b/src/tools/compiletest/src/runtest.rs index f8628158aff..17fa19afdd2 100644 --- a/src/tools/compiletest/src/runtest.rs +++ b/src/tools/compiletest/src/runtest.rs @@ -1565,7 +1565,7 @@ actual:\n\ fn aux_output_dir_name(&self) -> PathBuf { let f = self.output_base_name(); let mut fname = f.file_name().unwrap().to_os_string(); - fname.push(&format!(".{}.libaux", self.config.mode)); + fname.push(&format!("{}.aux", self.config.mode.disambiguator())); f.with_file_name(&fname) } -- cgit 1.4.1-3-g733a5