about summary refs log tree commit diff
path: root/src/bootstrap/flags.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/bootstrap/flags.rs')
-rw-r--r--src/bootstrap/flags.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs
index 42b949527e0..eb5c3b8ce14 100644
--- a/src/bootstrap/flags.rs
+++ b/src/bootstrap/flags.rs
@@ -60,6 +60,7 @@ pub enum Subcommand {
         test_args: Vec<String>,
         rustc_args: Vec<String>,
         fail_fast: bool,
+        doc_tests: bool,
     },
     Bench {
         paths: Vec<PathBuf>,
@@ -164,6 +165,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
                     "extra options to pass the compiler when running tests",
                     "ARGS",
                 );
+                opts.optflag("", "doc", "run doc tests");
             },
             "bench" => { opts.optmulti("", "test-args", "extra arguments", "ARGS"); },
             "clean" => { opts.optflag("", "all", "clean all build artifacts"); },
@@ -320,6 +322,7 @@ Arguments:
                     test_args: matches.opt_strs("test-args"),
                     rustc_args: matches.opt_strs("rustc-args"),
                     fail_fast: !matches.opt_present("no-fail-fast"),
+                    doc_tests: matches.opt_present("doc"),
                 }
             }
             "bench" => {
@@ -410,6 +413,13 @@ impl Subcommand {
             _ => false,
         }
     }
+
+    pub fn doc_tests(&self) -> bool {
+        match *self {
+            Subcommand::Test { doc_tests, .. } => doc_tests,
+            _ => false,
+        }
+    }
 }
 
 fn split(s: Vec<String>) -> Vec<String> {