Skip to content

Commit

Permalink
revert: Exit if a test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Apr 9, 2024
1 parent c7c4e22 commit d84f62c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
8 changes: 2 additions & 6 deletions xtask/src/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,15 @@ pub fn run_with_input(args: &[String], cwd: &Path) -> Result<()> {
bail!("The `cwd` argument MUST be a directory");
}

let status = Command::new(get_cargo())
let _status = Command::new(get_cargo())
.args(args)
.current_dir(cwd)
.stdout(std::process::Stdio::inherit())
.stderr(std::process::Stdio::inherit())
.stdin(std::process::Stdio::inherit())
.status()?;

if status.success() {
Ok(())
} else {
bail!("Failed to execute cargo subcommand")
}
Ok(())
}

fn get_cargo() -> String {
Expand Down
4 changes: 3 additions & 1 deletion xtask/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,9 @@ pub fn run_example(
let args = builder.build();
log::debug!("{args:#?}");

cargo::run_with_input(&args, package_path)
cargo::run_with_input(&args, package_path)?;

Ok(())
}

/// Build the specified package, using the given toolchain/target/features if
Expand Down

0 comments on commit d84f62c

Please sign in to comment.