]> git.lizzy.rs Git - rust.git/commitdiff
Move `x test --skip` to be part of `--exclude`
authorJoshua Nelson <jnelson@cloudflare.com>
Sun, 31 Jul 2022 23:25:09 +0000 (18:25 -0500)
committerJoshua Nelson <jnelson@cloudflare.com>
Sun, 31 Jul 2022 23:59:30 +0000 (18:59 -0500)
`--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.

If someone needs to use --skip for something other than compiletest,
they can use `--test-args --skip` instead.

src/bootstrap/builder/tests.rs
src/bootstrap/flags.rs
src/bootstrap/test.rs

index c084e77d3a9943c120395d961e2272788c938e43..280eba75f0c19166407927afcc17229edf38662b 100644 (file)
@@ -547,7 +547,6 @@ fn test_with_no_doc_stage0() {
         config.stage = 0;
         config.cmd = Subcommand::Test {
             paths: vec!["library/std".into()],
-            skip: vec![],
             test_args: vec![],
             rustc_args: vec![],
             fail_fast: true,
@@ -618,7 +617,6 @@ fn test_docs() {
         let mut config = configure(&["A"], &["A"]);
         config.cmd = Subcommand::Test {
             paths: vec![],
-            skip: vec![],
             test_args: vec![],
             rustc_args: vec![],
             fail_fast: true,
index 80b3bcce860163d23eea28a976de06ac3647385c..39d9ce1621ba2a751ae1007632f75a0d0012fa4b 100644 (file)
@@ -115,7 +115,6 @@ pub enum Subcommand {
         compare_mode: Option<String>,
         pass: Option<String>,
         run: Option<String>,
-        skip: Vec<String>,
         test_args: Vec<String>,
         rustc_args: Vec<String>,
         fail_fast: bool,
@@ -568,7 +567,6 @@ pub fn parse(args: &[String]) -> Flags {
                 compare_mode: matches.opt_str("compare-mode"),
                 pass: matches.opt_str("pass"),
                 run: matches.opt_str("run"),
-                skip: matches.opt_strs("skip"),
                 test_args: matches.opt_strs("test-args"),
                 rustc_args: matches.opt_strs("rustc-args"),
                 fail_fast: !matches.opt_present("no-fail-fast"),
@@ -707,16 +705,6 @@ pub fn kind(&self) -> Kind {
     pub fn test_args(&self) -> Vec<&str> {
         let mut args = vec![];
 
-        match *self {
-            Subcommand::Test { ref skip, .. } => {
-                for s in skip {
-                    args.push("--skip");
-                    args.push(s.as_str());
-                }
-            }
-            _ => (),
-        };
-
         match *self {
             Subcommand::Test { ref test_args, .. } | Subcommand::Bench { ref test_args, .. } => {
                 args.extend(test_args.iter().flat_map(|s| s.split_whitespace()))
index 5c8034d53e3ad95a4c43b7f855dcb954e165de20..fdd4a59bfcf3f6a02746102025a2904102469de6 100644 (file)
@@ -1488,6 +1488,11 @@ fn run(self, builder: &Builder<'_>) {
             cmd.arg("--run-clang-based-tests-with").arg(clang_exe);
         }
 
+        for exclude in &builder.config.exclude {
+            cmd.arg("--skip");
+            cmd.arg(&exclude.path);
+        }
+
         // Get paths from cmd args
         let paths = match &builder.config.cmd {
             Subcommand::Test { ref paths, .. } => &paths[..],