Skip to content

Commit

Permalink
Auto merge of #5904 - dwijnand:backslash, r=alexcrichton
Browse files Browse the repository at this point in the history
Remove backslash management in 2 tool_paths tests

With #5851 this is no longer necessary
  • Loading branch information
bors committed Aug 19, 2018
2 parents a06570c + 9d9883b commit a78f5aa
Showing 1 changed file with 5 additions and 26 deletions.
31 changes: 5 additions & 26 deletions tests/testsuite/tool_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ fn pathless_tools() {
#[test]
fn absolute_tools() {
let target = rustc_host();
let root = if cfg!(windows) { r#"C:\"# } else { "/" };

// Escaped as they appear within a TOML config file
let config = if cfg!(windows) {
Expand Down Expand Up @@ -67,26 +68,16 @@ fn absolute_tools() {
)
.build();

let output = if cfg!(windows) {
(
r#"C:\bogus\nonexistent-ar"#,
r#"C:\bogus\nonexistent-linker"#,
)
} else {
(r#"/bogus/nonexistent-ar"#, r#"/bogus/nonexistent-linker"#)
};

assert_that(
foo.cargo("build --verbose"),
execs().with_stderr(&format!(
"\
[COMPILING] foo v0.5.0 ({url})
[RUNNING] `rustc [..] -C ar={ar} -C linker={linker} [..]`
[RUNNING] `rustc [..] -C ar={root}bogus/nonexistent-ar -C linker={root}bogus/nonexistent-linker [..]`
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
url = foo.url(),
ar = output.0,
linker = output.1
root = root,
)),
)
}
Expand Down Expand Up @@ -126,29 +117,17 @@ fn relative_tools() {
let foo_path = p.root().join("bar");
let foo_url = path2url(&foo_path);
let prefix = p.root().into_os_string().into_string().unwrap();
let output = if cfg!(windows) {
(
format!(r#"{}\.\nonexistent-ar"#, prefix),
format!(r#"{}\.\tools\nonexistent-linker"#, prefix),
)
} else {
(
format!(r#"{}/./nonexistent-ar"#, prefix),
format!(r#"{}/./tools/nonexistent-linker"#, prefix),
)
};

assert_that(
p.cargo("build --verbose").cwd(foo_path),
execs().with_stderr(&format!(
"\
[COMPILING] bar v0.5.0 ({url})
[RUNNING] `rustc [..] -C ar={ar} -C linker={linker} [..]`
[RUNNING] `rustc [..] -C ar={prefix}/./nonexistent-ar -C linker={prefix}/./tools/nonexistent-linker [..]`
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
url = foo_url,
ar = output.0,
linker = output.1
prefix = prefix,
)),
)
}
Expand Down

0 comments on commit a78f5aa

Please sign in to comment.