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

Fix some tests failing on Windows nightly. #7534

Merged
merged 1 commit into from
Oct 24, 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
4 changes: 2 additions & 2 deletions tests/testsuite/dep_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ fn relative_depinfo_paths_ws() {

assert_deps_contains(
&p,
&format!("target/{}/debug/.fingerprint/foo-*/dep-bin-foo-*", host),
&format!("target/{}/debug/.fingerprint/foo-*/dep-bin-foo*", host),
&[
(1, "src/main.rs"),
(
Expand Down Expand Up @@ -403,7 +403,7 @@ fn relative_depinfo_paths_no_ws() {

assert_deps_contains(
&p,
"target/debug/.fingerprint/foo-*/dep-bin-foo-*",
"target/debug/.fingerprint/foo-*/dep-bin-foo*",
&[
(1, "src/main.rs"),
(
Expand Down
30 changes: 12 additions & 18 deletions tests/testsuite/test.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
use std::fs::{self, File};
use std::io::prelude::*;

use cargo;

use cargo_test_support::paths::CargoPathExt;
use cargo_test_support::registry::Package;
use cargo_test_support::{
basic_bin_manifest, basic_lib_manifest, basic_manifest, cargo_exe, project,
};
use cargo_test_support::{cross_compile, is_nightly, paths};
use cargo_test_support::{rustc_host, sleep_ms};
use std::fs;

#[cargo_test]
fn cargo_test_simple() {
Expand Down Expand Up @@ -2421,10 +2418,7 @@ fn bin_does_not_rebuild_tests() {
p.cargo("test -v").run();

sleep_ms(1000);
File::create(&p.root().join("src/main.rs"))
.unwrap()
.write_all(b"fn main() { 3; }")
.unwrap();
fs::write(p.root().join("src/main.rs"), "fn main() { 3; }").unwrap();

p.cargo("test -v --no-run")
.with_stderr(
Expand Down Expand Up @@ -3787,19 +3781,19 @@ fn cargo_test_doctest_xcompile_runner() {
let config = paths::root().join(".cargo/config");

fs::create_dir_all(config.parent().unwrap()).unwrap();
File::create(config)
.unwrap()
.write_all(
format!(
r#"
// Escape Windows backslashes for TOML config.
let runner_str = runner_path.to_str().unwrap().replace('\\', "\\\\");
fs::write(
config,
format!(
r#"
[target.'cfg(target_arch = "x86")']
runner = "{}"
"#,
runner_path.to_str().unwrap()
)
.as_bytes(),
)
.unwrap();
runner_str
),
)
.unwrap();

let p = project()
.file("Cargo.toml", &basic_lib_manifest("foo"))
Expand Down