Skip to content

Commit d7ba83a

Browse files
Merge pull request #33 from KodrAus/fix/build-plan
Fail early if cargo build returns non-zero exit code
2 parents 7a5b3d1 + 592c210 commit d7ba83a

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/util/mod.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use std::{
33
ffi::{OsStr, OsString},
44
fs,
55
path::{Path, PathBuf},
6-
process::{self, Command},
6+
process::{self, Command, Stdio},
77
};
88

99
use build_plan::BuildPlan;
@@ -23,9 +23,14 @@ pub(crate) fn get_dep_path() -> PathBuf {
2323
// an .so file on Linux).
2424
let output = Command::new(env!("CARGO"))
2525
.args(&["build", "-Z", "unstable-options", "--build-plan"])
26+
.stderr(Stdio::inherit())
2627
.output()
2728
.expect("failed to run `cargo build`");
2829

30+
if !output.status.success() {
31+
panic!("failed to run `cargo build`");
32+
}
33+
2934
// Parse JSON.
3035
let plan = BuildPlan::from_cargo_output(&output.stdout)
3136
.expect("unexpected Cargo build-plan output");

0 commit comments

Comments
 (0)