summary refs log tree commit diff
path: root/src/bootstrap/flags.rs
diff options
context:
space:
mode:
authorOliver Schneider <github35764891676564198441@oli-obk.de>2018-05-16 17:18:19 +0200
committerOliver Schneider <github35764891676564198441@oli-obk.de>2018-05-17 16:03:59 +0200
commit37dee69dacb0fc199d52d9baba3a3caf3018958a (patch)
tree1fabdaecf0b46a7fe4aea47fcb50c64daeca0283 /src/bootstrap/flags.rs
parente3150564f889a3bad01795d9fcb31d4f14d58a99 (diff)
downloadrust-37dee69dacb0fc199d52d9baba3a3caf3018958a.tar.gz
rust-37dee69dacb0fc199d52d9baba3a3caf3018958a.zip
Add `bless` x.py subcommand for easy ui test replacement
Diffstat (limited to 'src/bootstrap/flags.rs')
-rw-r--r--src/bootstrap/flags.rs12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs
index 5315a3028ff..8753ccc93cf 100644
--- a/src/bootstrap/flags.rs
+++ b/src/bootstrap/flags.rs
@@ -59,6 +59,8 @@ pub enum Subcommand {
     },
     Test {
         paths: Vec<PathBuf>,
+        /// Whether to automatically update stderr/stdout files
+        bless: bool,
         test_args: Vec<String>,
         rustc_args: Vec<String>,
         fail_fast: bool,
@@ -142,6 +144,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
         let subcommand = args.iter().find(|&s|
             (s == "build")
             || (s == "check")
+            || (s == "bless")
             || (s == "test")
             || (s == "bench")
             || (s == "doc")
@@ -162,6 +165,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
 
         // Some subcommands get extra options
         match subcommand.as_str() {
+            "bless" |
             "test"  => {
                 opts.optflag("", "no-fail-fast", "Run all tests regardless of failure");
                 opts.optmulti("", "test-args", "extra arguments", "ARGS");
@@ -249,6 +253,12 @@ Arguments:
     ignore the stage passed, as there's no way to compile in non-stage 0 without actually building
     the compiler.");
             }
+            "bless" => {
+                subcommand_help.push_str("\n
+Arguments:
+    This subcommand works exactly like the `test` subcommand, but also updates stderr/stdout files
+    before they cause a test failure");
+            }
             "test" => {
                 subcommand_help.push_str("\n
 Arguments:
@@ -319,9 +329,11 @@ Arguments:
             "check" => {
                 Subcommand::Check { paths: paths }
             }
+            "bless" |
             "test" => {
                 Subcommand::Test {
                     paths,
+                    bless: subcommand.as_str() == "bless",
                     test_args: matches.opt_strs("test-args"),
                     rustc_args: matches.opt_strs("rustc-args"),
                     fail_fast: !matches.opt_present("no-fail-fast"),