Skip to content

Commit 24cf45a

Browse files
committed
Auto merge of #100004 - jyn514:exclude-single-test, r=Mark-Simulacrum
Move `x test --skip` to be part of `--exclude` `--skip` is inconsistent with the rest of the interface and redundant with `--exclude`. Fix --exclude to work properly for files and directories rather than having a separate flag. Fixes #96342. cc #96493 (comment) r? `@Mark-Simulacrum`
2 parents cc71eef + f8ed52f commit 24cf45a

File tree

3 files changed

+5
-14
lines changed

3 files changed

+5
-14
lines changed

src/bootstrap/builder/tests.rs

-2
Original file line numberDiff line numberDiff line change
@@ -547,7 +547,6 @@ mod dist {
547547
config.stage = 0;
548548
config.cmd = Subcommand::Test {
549549
paths: vec!["library/std".into()],
550-
skip: vec![],
551550
test_args: vec![],
552551
rustc_args: vec![],
553552
fail_fast: true,
@@ -618,7 +617,6 @@ mod dist {
618617
let mut config = configure(&["A"], &["A"]);
619618
config.cmd = Subcommand::Test {
620619
paths: vec![],
621-
skip: vec![],
622620
test_args: vec![],
623621
rustc_args: vec![],
624622
fail_fast: true,

src/bootstrap/flags.rs

-12
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ pub enum Subcommand {
115115
compare_mode: Option<String>,
116116
pass: Option<String>,
117117
run: Option<String>,
118-
skip: Vec<String>,
119118
test_args: Vec<String>,
120119
rustc_args: Vec<String>,
121120
fail_fast: bool,
@@ -568,7 +567,6 @@ Arguments:
568567
compare_mode: matches.opt_str("compare-mode"),
569568
pass: matches.opt_str("pass"),
570569
run: matches.opt_str("run"),
571-
skip: matches.opt_strs("skip"),
572570
test_args: matches.opt_strs("test-args"),
573571
rustc_args: matches.opt_strs("rustc-args"),
574572
fail_fast: !matches.opt_present("no-fail-fast"),
@@ -707,16 +705,6 @@ impl Subcommand {
707705
pub fn test_args(&self) -> Vec<&str> {
708706
let mut args = vec![];
709707

710-
match *self {
711-
Subcommand::Test { ref skip, .. } => {
712-
for s in skip {
713-
args.push("--skip");
714-
args.push(s.as_str());
715-
}
716-
}
717-
_ => (),
718-
};
719-
720708
match *self {
721709
Subcommand::Test { ref test_args, .. } | Subcommand::Bench { ref test_args, .. } => {
722710
args.extend(test_args.iter().flat_map(|s| s.split_whitespace()))

src/bootstrap/test.rs

+5
Original file line numberDiff line numberDiff line change
@@ -1486,6 +1486,11 @@ note: if you're sure you want to do this, please open an issue as to why. In the
14861486
cmd.arg("--run-clang-based-tests-with").arg(clang_exe);
14871487
}
14881488

1489+
for exclude in &builder.config.exclude {
1490+
cmd.arg("--skip");
1491+
cmd.arg(&exclude.path);
1492+
}
1493+
14891494
// Get paths from cmd args
14901495
let paths = match &builder.config.cmd {
14911496
Subcommand::Test { ref paths, .. } => &paths[..],

0 commit comments

Comments
 (0)