Skip to content

Commit 0238f3e

Browse files
committed
compiletest: Use the new non-libtest executor by default (2)
(Re-landing rust-lang#139998, with a compiler change to inhibit download-rustc.) 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.
1 parent 862156d commit 0238f3e

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
@@ -414,10 +414,13 @@ pub struct Config {
414414
/// ABI tests.
415415
pub minicore_path: Utf8PathBuf,
416416

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

423426
impl Config {

src/tools/compiletest/src/lib.rs

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

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

451-
new_executor: matches.opt_present("new-executor"),
451+
no_new_executor: matches.opt_present("no-new-executor"),
452452
}
453453
}
454454

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

0 commit comments

Comments
 (0)