Skip to content

Commit cbfc364

Browse files
committed
compiletest: Remove the libtest-based executor and its dependency
This patch has deliberately been kept small and simple, to make it easier to revert if necessary. Further cleanup can take palce after we're confident that it won't need to be reverted.
1 parent 0134651 commit cbfc364

File tree

5 files changed

+8
-133
lines changed

5 files changed

+8
-133
lines changed

src/bootstrap/src/core/build_steps/tool.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ macro_rules! bootstrap_tool {
462462
}
463463
}
464464

465-
pub(crate) const COMPILETEST_ALLOW_FEATURES: &str = "test,internal_output_capture";
465+
pub(crate) const COMPILETEST_ALLOW_FEATURES: &str = "internal_output_capture";
466466

467467
bootstrap_tool!(
468468
// This is marked as an external tool because it includes dependencies

src/tools/compiletest/src/common.rs

-8
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,6 @@ pub struct Config {
413413
/// cross-compilation scenarios that do not otherwise want/need to `-Zbuild-std`. Used in e.g.
414414
/// ABI tests.
415415
pub minicore_path: Utf8PathBuf,
416-
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,
424416
}
425417

426418
impl Config {

src/tools/compiletest/src/executor.rs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ use crate::common::{Config, TestPaths};
1212

1313
mod deadline;
1414
mod json;
15-
pub(crate) mod libtest;
1615

1716
pub(crate) fn run_tests(config: &Config, tests: Vec<CollectedTest>) -> bool {
1817
let tests_len = tests.len();

src/tools/compiletest/src/executor/libtest.rs

-111
This file was deleted.

src/tools/compiletest/src/lib.rs

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#![crate_name = "compiletest"]
2-
// Needed by the libtest-based test executor.
3-
#![feature(test)]
42
// Needed by the "new" test executor that does not depend on libtest.
3+
// FIXME(Zalathar): We should be able to get rid of `internal_output_capture`,
4+
// by having `runtest` manually capture all of its println-like output instead.
5+
// That would result in compiletest being written entirely in stable Rust!
56
#![feature(internal_output_capture)]
67

7-
extern crate test;
8-
98
#[cfg(test)]
109
mod tests;
1110

@@ -448,8 +447,6 @@ pub fn parse_config(args: Vec<String>) -> Config {
448447
diff_command: matches.opt_str("compiletest-diff-tool"),
449448

450449
minicore_path: opt_path(matches, "minicore-path"),
451-
452-
no_new_executor: matches.opt_present("no-new-executor"),
453450
}
454451
}
455452

@@ -576,12 +573,10 @@ pub fn run_tests(config: Arc<Config>) {
576573
// Delegate to the executor to filter and run the big list of test structures
577574
// created during test discovery. When the executor decides to run a test,
578575
// it will return control to the rest of compiletest by calling `runtest::run`.
579-
let res = if !config.no_new_executor {
580-
Ok(executor::run_tests(&config, tests))
581-
} else {
582-
// FIXME(Zalathar): Eventually remove the libtest executor entirely.
583-
crate::executor::libtest::execute_tests(&config, tests)
584-
};
576+
// FIXME(Zalathar): Once we're confident that we won't need to revert the
577+
// removal of the libtest-based executor, remove this Result and other
578+
// remnants of the old executor.
579+
let res: io::Result<bool> = Ok(executor::run_tests(&config, tests));
585580

586581
// Check the outcome reported by libtest.
587582
match res {

0 commit comments

Comments
 (0)