diff options
author | Zach Reizner <zachr@google.com> | 2018-09-20 14:41:40 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2018-09-22 01:43:11 -0700 |
commit | a1422e6bcab81492d20ae312c92cdc2491705876 (patch) | |
tree | 11ba1cfc1630e94ea4736c649d42ae1380bd10b6 /tests | |
parent | 0a4f280e3a1c3ba77e1efa37c18bbdcea03a0d64 (diff) | |
download | crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar.gz crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar.bz2 crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar.lz crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar.xz crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.tar.zst crosvm-a1422e6bcab81492d20ae312c92cdc2491705876.zip |
fix warning and bit rotted tests uncovered by kokoro
TEST=run kokoro presubmit BUG=None Change-Id: I301551f8f58263f1a8b7a8276867881cb17517ab Reviewed-on: https://chromium-review.googlesource.com/1236889 Commit-Ready: Zach Reizner <zachr@chromium.org> Tested-by: Zach Reizner <zachr@chromium.org> Reviewed-by: Stephen Barber <smbarber@chromium.org>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/plugins.rs | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/plugins.rs b/tests/plugins.rs index 987b033..67e68e6 100644 --- a/tests/plugins.rs +++ b/tests/plugins.rs @@ -35,6 +35,16 @@ fn get_target_path() -> PathBuf { .ok() .map(|mut path| { path.pop(); + path + }) + .expect("failed to get crosvm binary directory") +} + +fn get_crosvm_path() -> PathBuf { + current_exe() + .ok() + .map(|mut path| { + path.pop(); if path.ends_with("deps") { path.pop(); } @@ -44,8 +54,8 @@ fn get_target_path() -> PathBuf { } fn build_plugin(src: &str) -> RemovePath { - let mut out_bin = PathBuf::from("target"); let libcrosvm_plugin_dir = get_target_path(); + let mut out_bin = libcrosvm_plugin_dir.clone(); out_bin.push(thread_rng() .gen_ascii_chars() .take(10) @@ -77,7 +87,7 @@ fn build_plugin(src: &str) -> RemovePath { } fn run_plugin(bin_path: &Path, with_sandbox: bool) { - let mut crosvm_path = get_target_path(); + let mut crosvm_path = get_crosvm_path(); crosvm_path.push("crosvm"); let mut cmd = Command::new(crosvm_path); cmd.args(&["run", |