From 414eb48b66ff694126bb12cf4ab8aed06ca4965e Mon Sep 17 00:00:00 2001 From: yukang Date: Sat, 4 Feb 2023 00:23:11 +0800 Subject: add only modified for compiletest --- src/bootstrap/flags.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/bootstrap/flags.rs') diff --git a/src/bootstrap/flags.rs b/src/bootstrap/flags.rs index 52c3dc0bf75..ff927ed561b 100644 --- a/src/bootstrap/flags.rs +++ b/src/bootstrap/flags.rs @@ -124,6 +124,7 @@ pub enum Subcommand { fail_fast: bool, doc_tests: DocTests, rustfix_coverage: bool, + only_modified: bool, }, Bench { paths: Vec, @@ -301,6 +302,7 @@ To learn more about a subcommand, run `./x.py -h`", opts.optflag("", "doc", "only run doc tests"); opts.optflag("", "bless", "update all stderr/stdout files of failing ui tests"); opts.optflag("", "force-rerun", "rerun tests even if the inputs are unchanged"); + opts.optflag("", "only-modified", "only run tests that result has been changed"); opts.optopt( "", "compare-mode", @@ -598,6 +600,7 @@ Arguments: rustc_args: matches.opt_strs("rustc-args"), fail_fast: !matches.opt_present("no-fail-fast"), rustfix_coverage: matches.opt_present("rustfix-coverage"), + only_modified: matches.opt_present("only-modified"), doc_tests: if matches.opt_present("doc") { DocTests::Only } else if matches.opt_present("no-doc") { @@ -777,6 +780,13 @@ impl Subcommand { } } + pub fn only_modified(&self) -> bool { + match *self { + Subcommand::Test { only_modified, .. } => only_modified, + _ => false, + } + } + pub fn force_rerun(&self) -> bool { match *self { Subcommand::Test { force_rerun, .. } => force_rerun, -- cgit 1.4.1-3-g733a5