Skip to content

Commit

Permalink
Auto merge of rust-lang#5316 - lzutao:osstr, r=phansch
Browse files Browse the repository at this point in the history
Don't convert Path to lossy str

changelog: none
  • Loading branch information
bors committed Mar 15, 2020
2 parents 8fd7e31 + 9febcf5 commit c1a138c
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions tests/integration.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#![cfg(feature = "integration")]

use std::env;
use std::ffi::OsStr;
use std::process::Command;

#[cfg_attr(feature = "integration", test)]
Expand All @@ -12,13 +13,16 @@ fn integration_test() {
.nth(1)
.expect("repo name should have format `<org>/<name>`");

let repo_dir = tempfile::tempdir()
.expect("couldn't create temp dir")
.path()
.join(crate_name);
let mut repo_dir = tempfile::tempdir().expect("couldn't create temp dir").into_path();
repo_dir.push(crate_name);

let st = Command::new("git")
.args(&["clone", "--depth=1", &repo_url, repo_dir.to_str().unwrap()])
.args(&[
OsStr::new("clone"),
OsStr::new("--depth=1"),
OsStr::new(&repo_url),
OsStr::new(&repo_dir),
])
.status()
.expect("unable to run git");
assert!(st.success());
Expand Down Expand Up @@ -68,13 +72,8 @@ fn integration_test() {
}

match output.status.code() {
Some(code) => {
if code == 0 {
println!("Compilation successful");
} else {
eprintln!("Compilation failed. Exit code: {}", code);
}
},
Some(0) => println!("Compilation successful"),
Some(code) => eprintln!("Compilation failed. Exit code: {}", code),
None => panic!("Process terminated by signal"),
}
}

0 comments on commit c1a138c

Please sign in to comment.