Skip to content

Shorten paths to auxiliary files created by tests #45748

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ impl_stable_hash_for!(struct self::OutputFilenames {
outputs
});

pub const RUST_CGU_EXT: &str = "rust-cgu";
pub const RUST_CGU_EXT: &str = "rcgu";

impl OutputFilenames {
pub fn path(&self, flavor: OutputType) -> PathBuf {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_trans/back/link.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1222,7 +1222,7 @@ fn add_upstream_rust_crates(cmd: &mut Linker,
let canonical = f.replace("-", "_");
let canonical_name = name.replace("-", "_");

// Look for `.rust-cgu.o` at the end of the filename to conclude
// Look for `.rcgu.o` at the end of the filename to conclude
// that this is a Rust-related object file.
fn looks_like_rust(s: &str) -> bool {
let path = Path::new(s);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

all:
$(RUSTC) -C extra-filename=bar foo.rs -C save-temps
rm $(TMPDIR)/foobar.foo0.rust-cgu.o
rm $(TMPDIR)/foobar.foo0.rcgu.o
rm $(TMPDIR)/$(call BIN,foobar)
14 changes: 14 additions & 0 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Mode, ()> {
Expand Down
2 changes: 1 addition & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down