Skip to content

Commit 40ab1eb

Browse files
committed
fix oversight in my cli test system: it needed to lookup target binary, not our PATH.
(This functionality is also available via other means, such as `$CARGO_BIN_EXE_<name>` and https://crates.io/crates/assert_cmd. I opted not to use the builtin env variable because that is only available in very recent cargo versions, and I would prefer our test suite to work peven on older versions of cargo, if that is feasible...)
1 parent 670ec6e commit 40ab1eb

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,3 +36,4 @@ colored="1.9"
3636
[dev-dependencies]
3737
quickcheck = "0.9.2"
3838
tempfile = "3.1.0"
39+
test_bin= "0.3.0"

tests/common/command_invocation.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use std::path::Path;
2-
use std::process::{Command, ExitStatus};
2+
use std::process::ExitStatus;
33

44
pub(crate) struct Context<'a> {
55
pub cli_params: &'a [&'a str],
@@ -14,14 +14,16 @@ pub struct Output {
1414

1515
impl<'a> Context<'a> {
1616
pub fn run(&mut self) -> Result<Output, failure::Error> {
17-
let mut command = Command::new("cargo-bisect-rustc");
17+
let mut command = test_bin::get_test_bin("cargo-bisect-rustc");
1818
for param in self.cli_params {
1919
command.arg(param);
2020
}
2121
let dir = self.dir;
22-
println!("running `cargo-bisect-rustc {}` in {:?}",
22+
println!("running `{:?} {}` in {:?}",
23+
command,
2324
self.cli_params.join(" "),
2425
dir.display());
26+
assert!(dir.exists());
2527
let output = command.current_dir(dir).output()?;
2628

2729
let stderr = String::from_utf8_lossy(&output.stderr);

0 commit comments

Comments
 (0)