Skip to content

Commit c64db2c

Browse files
committed
use build_helper::util::try_run in rustdoc-gui-test
Signed-off-by: ozkanonur <[email protected]>
1 parent 2803c66 commit c64db2c

File tree

3 files changed

+3
-17
lines changed

3 files changed

+3
-17
lines changed

Cargo.lock

+1
Original file line numberDiff line numberDiff line change
@@ -4383,6 +4383,7 @@ dependencies = [
43834383
name = "rustdoc-gui-test"
43844384
version = "0.1.0"
43854385
dependencies = [
4386+
"build_helper",
43864387
"compiletest",
43874388
"getopts",
43884389
"walkdir",

src/tools/rustdoc-gui-test/Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies]
7+
build_helper = { path = "../build_helper" }
78
compiletest = { path = "../compiletest" }
89
getopts = "0.2"
910
walkdir = "2"

src/tools/rustdoc-gui-test/src/main.rs

+1-17
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
use build_helper::util::try_run;
12
use compiletest::header::TestProps;
23
use config::Config;
34
use std::path::{Path, PathBuf};
@@ -60,23 +61,6 @@ fn find_librs<P: AsRef<Path>>(path: P) -> Option<PathBuf> {
6061
None
6162
}
6263

63-
// FIXME: move `bootstrap::util::try_run` into `build_helper` crate
64-
// and use that one instead of creating this function.
65-
fn try_run(cmd: &mut Command, print_cmd_on_fail: bool) -> bool {
66-
let status = match cmd.status() {
67-
Ok(status) => status,
68-
Err(e) => panic!("failed to execute command: {:?}\nerror: {}", cmd, e),
69-
};
70-
if !status.success() && print_cmd_on_fail {
71-
println!(
72-
"\n\ncommand did not execute successfully: {:?}\n\
73-
expected success, got: {}\n\n",
74-
cmd, status
75-
);
76-
}
77-
status.success()
78-
}
79-
8064
fn main() {
8165
let config = Arc::new(Config::from_args(env::args().collect()));
8266

0 commit comments

Comments
 (0)