Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions src/tools/compiletest/src/bin/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use std::env;
use std::io::IsTerminal;
use std::sync::Arc;

use compiletest::{early_config_check, log_config, parse_config, run_tests};
use compiletest::{early_config_check, parse_config, run_tests};

fn main() {
tracing_subscriber::fmt::init();
Expand All @@ -19,6 +19,5 @@ fn main() {

early_config_check(&config);

log_config(&config);
run_tests(config);
}
48 changes: 2 additions & 46 deletions src/tools/compiletest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ use crate::common::{
};
use crate::directives::DirectivesCache;
use crate::executor::{CollectedTest, ColorConfig};
use crate::util::logv;

/// Creates the `Config` instance for this invocation of compiletest.
///
Expand Down Expand Up @@ -477,51 +476,6 @@ pub fn parse_config(args: Vec<String>) -> Config {
}
}

pub fn log_config(config: &Config) {
let c = config;
logv(c, "configuration:".to_string());
logv(c, format!("compile_lib_path: {}", config.compile_lib_path));
logv(c, format!("run_lib_path: {}", config.run_lib_path));
logv(c, format!("rustc_path: {}", config.rustc_path));
logv(c, format!("cargo_path: {:?}", config.cargo_path));
logv(c, format!("rustdoc_path: {:?}", config.rustdoc_path));

logv(c, format!("src_root: {}", config.src_root));
logv(c, format!("src_test_suite_root: {}", config.src_test_suite_root));

logv(c, format!("build_root: {}", config.build_root));
logv(c, format!("build_test_suite_root: {}", config.build_test_suite_root));

logv(c, format!("sysroot_base: {}", config.sysroot_base));

logv(c, format!("stage: {}", config.stage));
logv(c, format!("stage_id: {}", config.stage_id));
logv(c, format!("mode: {}", config.mode));
logv(c, format!("run_ignored: {}", config.run_ignored));
logv(c, format!("filters: {:?}", config.filters));
logv(c, format!("skip: {:?}", config.skip));
logv(c, format!("filter_exact: {}", config.filter_exact));
logv(
c,
format!("force_pass_mode: {}", opt_str(&config.force_pass_mode.map(|m| format!("{}", m))),),
);
logv(c, format!("runner: {}", opt_str(&config.runner)));
logv(c, format!("host-rustcflags: {:?}", config.host_rustcflags));
logv(c, format!("target-rustcflags: {:?}", config.target_rustcflags));
logv(c, format!("target: {}", config.target));
logv(c, format!("host: {}", config.host));
logv(c, format!("android-cross-path: {}", config.android_cross_path));
logv(c, format!("adb_path: {}", config.adb_path));
logv(c, format!("adb_test_dir: {}", config.adb_test_dir));
logv(c, format!("adb_device_status: {}", config.adb_device_status));
logv(c, format!("ar: {}", config.ar));
logv(c, format!("target-linker: {:?}", config.target_linker));
logv(c, format!("host-linker: {:?}", config.host_linker));
logv(c, format!("verbose: {}", config.verbose));
logv(c, format!("minicore_path: {}", config.minicore_path));
logv(c, "\n".to_string());
}

pub fn opt_str(maybestr: &Option<String>) -> &str {
match *maybestr {
None => "(none)",
Expand All @@ -538,6 +492,8 @@ pub fn opt_str2(maybestr: Option<String>) -> String {

/// Called by `main` after the config has been parsed.
pub fn run_tests(config: Arc<Config>) {
debug!(?config, "run_tests");
Copy link
Member

@jieyouxu jieyouxu Aug 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussion: hm, I think it was originally intended so the config gets logged when run in CI?

EDIT: wait no, that can't be right, I don't remember us passing --verbose in CI 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we suspect it's still useful, I can add in a println!("{config:#?}") to just dump the whole config.

(It's mostly redundant with the compiletest command-line arguments that ./x --verbose will print out anyway, but I suppose that seeing the post-parse config could have some value.)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm right. I think we might want to dump the post-parse config under CI env, but not necessary for this PR.


// If we want to collect rustfix coverage information,
// we first make sure that the coverage file does not exist.
// It will be created later on.
Expand Down