Skip to content

Commit be181dd

Browse files
committed
Auto merge of #139998 - Zalathar:new-executor, r=onur-ozkan
compiletest: Use the new non-libtest executor by default The new executor was implemented in #139660, but required a manual opt-in. This PR activates the new executor by default, but leaves the old libtest-based executor in place (temporarily) to make reverting easier if something unexpectedly goes horribly wrong. Currently the new executor can be explicitly disabled by passing the `-N` flag to compiletest (e.g. `./x test ui -- -N`), but eventually that flag will be removed, alongside the removal of the libtest dependency. The flag is mostly there to make manual comparative testing easier if something does go wrong. As before, there *should* be no user-visible difference between the old executor and the new executor. --- I didn't get much of a response to my [call for testing thread on Zulip](https://rust-lang.zulipchat.com/#narrow/channel/122651-general/topic/Call.20for.20testing.3A.20New.20test.20executor.20for.20compiletest/with/512452105), and the reports I did get (along with my own usage) indicate that there aren't any problems. So I think it's reasonable to move forward with making this the default, in the hopes of being able to remove the libtest dependency relatively soon. When the libtest dependency is removed, it should be reasonable to build compiletest against pre-built stage0 std by default, even after the stage0 redesign. (Though we should probably have at least one CI job using in-tree stage1 std instead, to guard against the possibility of the `#![feature(internal_output_capture)]` API actually changing.)
2 parents 645d0ad + bf4b2a9 commit be181dd

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/tools/compiletest/src/common.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -415,10 +415,13 @@ pub struct Config {
415415
/// ABI tests.
416416
pub minicore_path: Utf8PathBuf,
417417

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

424427
impl Config {

src/tools/compiletest/src/lib.rs

+4-3
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
203203
"COMMAND",
204204
)
205205
.reqopt("", "minicore-path", "path to minicore aux library", "PATH")
206-
.optflag("n", "new-executor", "enables the new test executor instead of using libtest")
206+
.optflag("N", "no-new-executor", "disables the new test executor, and uses libtest instead")
207207
.optopt(
208208
"",
209209
"debugger",
@@ -450,7 +450,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
450450

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

453-
new_executor: matches.opt_present("new-executor"),
453+
no_new_executor: matches.opt_present("no-new-executor"),
454454
}
455455
}
456456

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

0 commit comments

Comments
 (0)