use build_helper::util::try_run
in rustdoc-gui-test
Signed-off-by: ozkanonur <work@onurozkan.dev>
This commit is contained in:
parent
2803c66006
commit
c64db2cfa7
3 changed files with 3 additions and 17 deletions
|
@ -4383,6 +4383,7 @@ dependencies = [
|
|||
name = "rustdoc-gui-test"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"build_helper",
|
||||
"compiletest",
|
||||
"getopts",
|
||||
"walkdir",
|
||||
|
|
|
@ -4,6 +4,7 @@ version = "0.1.0"
|
|||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
build_helper = { path = "../build_helper" }
|
||||
compiletest = { path = "../compiletest" }
|
||||
getopts = "0.2"
|
||||
walkdir = "2"
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
use build_helper::util::try_run;
|
||||
use compiletest::header::TestProps;
|
||||
use config::Config;
|
||||
use std::path::{Path, PathBuf};
|
||||
|
@ -60,23 +61,6 @@ fn find_librs<P: AsRef<Path>>(path: P) -> Option<PathBuf> {
|
|||
None
|
||||
}
|
||||
|
||||
// FIXME: move `bootstrap::util::try_run` into `build_helper` crate
|
||||
// and use that one instead of creating this function.
|
||||
fn try_run(cmd: &mut Command, print_cmd_on_fail: bool) -> bool {
|
||||
let status = match cmd.status() {
|
||||
Ok(status) => status,
|
||||
Err(e) => panic!("failed to execute command: {:?}\nerror: {}", cmd, e),
|
||||
};
|
||||
if !status.success() && print_cmd_on_fail {
|
||||
println!(
|
||||
"\n\ncommand did not execute successfully: {:?}\n\
|
||||
expected success, got: {}\n\n",
|
||||
cmd, status
|
||||
);
|
||||
}
|
||||
status.success()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let config = Arc::new(Config::from_args(env::args().collect()));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue