diff options
| author | ozkanonur <work@onurozkan.dev> | 2023-05-30 10:54:40 +0300 |
|---|---|---|
| committer | ozkanonur <work@onurozkan.dev> | 2023-05-30 10:54:40 +0300 |
| commit | c64db2cfa7d0e4a9331d280044715c49bbea6e2d (patch) | |
| tree | 6b92c7c70540836c6b636a9cbcff42604bbf4466 /src | |
| parent | 2803c66006b37a12c16e15cdb9873565f4c585d2 (diff) | |
| download | rust-c64db2cfa7d0e4a9331d280044715c49bbea6e2d.tar.gz rust-c64db2cfa7d0e4a9331d280044715c49bbea6e2d.zip | |
use `build_helper::util::try_run` in rustdoc-gui-test
Signed-off-by: ozkanonur <work@onurozkan.dev>
Diffstat (limited to 'src')
| -rw-r--r-- | src/tools/rustdoc-gui-test/Cargo.toml | 1 | ||||
| -rw-r--r-- | src/tools/rustdoc-gui-test/src/main.rs | 18 |
2 files changed, 2 insertions, 17 deletions
diff --git a/src/tools/rustdoc-gui-test/Cargo.toml b/src/tools/rustdoc-gui-test/Cargo.toml index f0c5b367117..4cb200ebc7c 100644 --- a/src/tools/rustdoc-gui-test/Cargo.toml +++ b/src/tools/rustdoc-gui-test/Cargo.toml @@ -4,6 +4,7 @@ version = "0.1.0" edition = "2021" [dependencies] +build_helper = { path = "../build_helper" } compiletest = { path = "../compiletest" } getopts = "0.2" walkdir = "2" diff --git a/src/tools/rustdoc-gui-test/src/main.rs b/src/tools/rustdoc-gui-test/src/main.rs index af9b4e9d680..3f60a90f87a 100644 --- a/src/tools/rustdoc-gui-test/src/main.rs +++ b/src/tools/rustdoc-gui-test/src/main.rs @@ -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())); |
