Skip to content
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

Re-enable some MSVC tests. #7492

Merged
merged 1 commit into from
Oct 8, 2019
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: 2 additions & 0 deletions src/cargo/core/compiler/context/compilation_files.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ fn compute_metadata<'a, 'cfg>(
//
// No metadata for bin because of an issue:
// - wasm32 rustc/emcc encodes the `.wasm` name in the `.js` (rust-lang/cargo#4535).
// - msvc: The path to the PDB is embedded in the executable, and we don't
// want the PDB path to include the hash in it.
//
// Two exceptions:
// 1) Upstream dependencies (we aren't exporting + need to resolve name conflict),
Expand Down
6 changes: 3 additions & 3 deletions tests/testsuite/collisions.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#[cfg(not(target_env = "msvc"))]
use cargo_test_support::basic_manifest;
use cargo_test_support::project;
use std::env;
Expand Down Expand Up @@ -56,7 +55,6 @@ This may become a hard error in the future; see <https://github.com/rust-lang/ca
}

#[cargo_test]
#[cfg(not(target_env = "msvc"))]
fn collision_example() {
// Examples in a workspace can easily collide.
let p = project()
Expand All @@ -73,7 +71,9 @@ fn collision_example() {
.file("b/examples/ex1.rs", "fn main() {}")
.build();

p.cargo("build --examples")
// `j=1` is required because on Windows you'll get an error due to
// two processes writing to the file at the same time.
p.cargo("build --examples -j=1")
.with_stderr_contains("\
[WARNING] output filename collision.
The example target `ex1` in package `b v1.0.0 ([..]/foo/b)` has the same output filename as the example target `ex1` in package `a v1.0.0 ([..]/foo/a)`.
Expand Down
30 changes: 15 additions & 15 deletions tests/testsuite/freshness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,6 @@ fn changing_bin_paths_common_target_features_caches_targets() {
}

#[cargo_test]
#[cfg(not(target_env = "msvc"))]
fn changing_bin_features_caches_targets() {
let p = project()
.file(
Expand Down Expand Up @@ -471,22 +470,23 @@ fn changing_bin_features_caches_targets() {

/* Targets should be cached from the first build */

p.cargo("build")
.with_stderr(
"\
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
let mut e = p.cargo("build");
// MSVC does not include hash in binary filename, so it gets recompiled.
if cfg!(target_env = "msvc") {
e.with_stderr("[COMPILING] foo[..]\n[FINISHED] dev[..]");
} else {
e.with_stderr("[FINISHED] dev[..]");
}
e.run();
p.rename_run("foo", "off2").with_stdout("feature off").run();

p.cargo("build --features foo")
.with_stderr(
"\
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]
",
)
.run();
let mut e = p.cargo("build --features foo");
if cfg!(target_env = "msvc") {
e.with_stderr("[COMPILING] foo[..]\n[FINISHED] dev[..]");
} else {
e.with_stderr("[FINISHED] dev[..]");
}
e.run();
p.rename_run("foo", "on2").with_stdout("feature on").run();
}

Expand Down