Skip to content

compiletest: Use the new non-libtest executor by default #139998

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 7 additions & 4 deletions src/tools/compiletest/src/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,10 +415,13 @@ pub struct Config {
/// ABI tests.
pub minicore_path: Utf8PathBuf,

/// If true, run tests with the "new" executor that was written to replace
/// compiletest's dependency on libtest. Eventually this will become the
/// default, and the libtest dependency will be removed.
pub new_executor: bool,
/// If true, disable the "new" executor, and use the older libtest-based
/// executor to run tests instead. This is a temporary fallback, to make
/// manual comparative testing easier if bugs are found in the new executor.
///
/// FIXME(Zalathar): Eventually remove this flag and remove the libtest
/// dependency.
pub no_new_executor: bool,
}

impl Config {
Expand Down
7 changes: 4 additions & 3 deletions src/tools/compiletest/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
"COMMAND",
)
.reqopt("", "minicore-path", "path to minicore aux library", "PATH")
.optflag("n", "new-executor", "enables the new test executor instead of using libtest")
.optflag("N", "no-new-executor", "disables the new test executor, and uses libtest instead")
.optopt(
"",
"debugger",
Expand Down Expand Up @@ -450,7 +450,7 @@ pub fn parse_config(args: Vec<String>) -> Config {

minicore_path: opt_path(matches, "minicore-path"),

new_executor: matches.opt_present("new-executor"),
no_new_executor: matches.opt_present("no-new-executor"),
}
}

Expand Down Expand Up @@ -577,9 +577,10 @@ pub fn run_tests(config: Arc<Config>) {
// Delegate to the executor to filter and run the big list of test structures
// created during test discovery. When the executor decides to run a test,
// it will return control to the rest of compiletest by calling `runtest::run`.
let res = if config.new_executor {
let res = if !config.no_new_executor {
Ok(executor::run_tests(&config, tests))
} else {
// FIXME(Zalathar): Eventually remove the libtest executor entirely.
crate::executor::libtest::execute_tests(&config, tests)
};

Expand Down
Loading