From 37dee69dacb0fc199d52d9baba3a3caf3018958a Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Wed, 16 May 2018 17:18:19 +0200 Subject: Add `bless` x.py subcommand for easy ui test replacement --- src/bootstrap/flags.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/bootstrap/flags.rs') 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, + /// Whether to automatically update stderr/stdout files + bless: bool, test_args: Vec, rustc_args: Vec, fail_fast: bool, @@ -142,6 +144,7 @@ To learn more about a subcommand, run `./x.py -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 -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"); @@ -248,6 +252,12 @@ Arguments: compilation, so there's no need to pass it separately, though it won't hurt. We also completely 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 @@ -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"), -- cgit 1.4.1-3-g733a5