Skip to content

Commit c8cef5b

Browse files
committed
Move some early config checks to the compiletest lib
1 parent f191420 commit c8cef5b

File tree

2 files changed

+17
-14
lines changed

2 files changed

+17
-14
lines changed

src/tools/compiletest/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,3 +1111,18 @@ fn check_for_overlapping_test_paths(found_path_stems: &HashSet<Utf8PathBuf>) {
11111111
);
11121112
}
11131113
}
1114+
1115+
pub fn early_config_check(config: &Config) {
1116+
if !config.has_html_tidy && config.mode == Mode::Rustdoc {
1117+
eprintln!("warning: `tidy` (html-tidy.org) is not installed; diffs will not be generated");
1118+
}
1119+
1120+
if !config.profiler_runtime && config.mode == Mode::CoverageRun {
1121+
let actioned = if config.bless { "blessed" } else { "checked" };
1122+
eprintln!(
1123+
r#"
1124+
WARNING: profiler runtime is not available, so `.coverage` files won't be {actioned}
1125+
help: try setting `profiler = true` in the `[build]` section of `bootstrap.toml`"#
1126+
);
1127+
}
1128+
}

src/tools/compiletest/src/main.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ use std::env;
22
use std::io::IsTerminal;
33
use std::sync::Arc;
44

5-
use compiletest::common::Mode;
6-
use compiletest::{log_config, parse_config, run_tests};
5+
use compiletest::{early_config_check, log_config, parse_config, run_tests};
76

87
fn main() {
98
tracing_subscriber::fmt::init();
@@ -18,18 +17,7 @@ fn main() {
1817

1918
let config = Arc::new(parse_config(env::args().collect()));
2019

21-
if !config.has_html_tidy && config.mode == Mode::Rustdoc {
22-
eprintln!("warning: `tidy` (html-tidy.org) is not installed; diffs will not be generated");
23-
}
24-
25-
if !config.profiler_runtime && config.mode == Mode::CoverageRun {
26-
let actioned = if config.bless { "blessed" } else { "checked" };
27-
eprintln!(
28-
r#"
29-
WARNING: profiler runtime is not available, so `.coverage` files won't be {actioned}
30-
help: try setting `profiler = true` in the `[build]` section of `bootstrap.toml`"#
31-
);
32-
}
20+
early_config_check(&config);
3321

3422
log_config(&config);
3523
run_tests(config);

0 commit comments

Comments
 (0)