Add x.py option to --force-rerun compiletest tests
This commit is contained in:
parent
d5fd37f00f
commit
b7e9b1ad7f
5 changed files with 32 additions and 7 deletions
|
@ -486,6 +486,7 @@ mod dist {
|
|||
fail_fast: true,
|
||||
doc_tests: DocTests::No,
|
||||
bless: false,
|
||||
force_rerun: false,
|
||||
compare_mode: None,
|
||||
rustfix_coverage: false,
|
||||
pass: None,
|
||||
|
@ -527,6 +528,7 @@ mod dist {
|
|||
fail_fast: true,
|
||||
doc_tests: DocTests::No,
|
||||
bless: false,
|
||||
force_rerun: false,
|
||||
compare_mode: None,
|
||||
rustfix_coverage: false,
|
||||
pass: None,
|
||||
|
@ -583,6 +585,7 @@ mod dist {
|
|||
fail_fast: true,
|
||||
doc_tests: DocTests::Yes,
|
||||
bless: false,
|
||||
force_rerun: false,
|
||||
compare_mode: None,
|
||||
rustfix_coverage: false,
|
||||
pass: None,
|
||||
|
|
|
@ -102,6 +102,7 @@ pub enum Subcommand {
|
|||
paths: Vec<PathBuf>,
|
||||
/// Whether to automatically update stderr/stdout files
|
||||
bless: bool,
|
||||
force_rerun: bool,
|
||||
compare_mode: Option<String>,
|
||||
pass: Option<String>,
|
||||
run: Option<String>,
|
||||
|
@ -284,6 +285,7 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`",
|
|||
opts.optflag("", "no-doc", "do not run doc tests");
|
||||
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.optopt(
|
||||
"",
|
||||
"compare-mode",
|
||||
|
@ -558,6 +560,7 @@ Arguments:
|
|||
"test" | "t" => Subcommand::Test {
|
||||
paths,
|
||||
bless: matches.opt_present("bless"),
|
||||
force_rerun: matches.opt_present("force-rerun"),
|
||||
compare_mode: matches.opt_str("compare-mode"),
|
||||
pass: matches.opt_str("pass"),
|
||||
run: matches.opt_str("run"),
|
||||
|
@ -726,6 +729,13 @@ impl Subcommand {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn force_rerun(&self) -> bool {
|
||||
match *self {
|
||||
Subcommand::Test { force_rerun, .. } => force_rerun,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn rustfix_coverage(&self) -> bool {
|
||||
match *self {
|
||||
Subcommand::Test { rustfix_coverage, .. } => rustfix_coverage,
|
||||
|
|
|
@ -1315,6 +1315,10 @@ note: if you're sure you want to do this, please open an issue as to why. In the
|
|||
cmd.arg("--bless");
|
||||
}
|
||||
|
||||
if builder.config.cmd.force_rerun() {
|
||||
cmd.arg("--force-rerun");
|
||||
}
|
||||
|
||||
let compare_mode =
|
||||
builder.config.cmd.compare_mode().or_else(|| {
|
||||
if builder.config.test_compare_mode { self.compare_mode } else { None }
|
||||
|
|
|
@ -362,6 +362,9 @@ pub struct Config {
|
|||
pub nodejs: Option<String>,
|
||||
/// Path to a npm executable. Used for rustdoc GUI tests
|
||||
pub npm: Option<String>,
|
||||
|
||||
/// Whether to rerun tests even if the inputs are unchanged.
|
||||
pub force_rerun: bool,
|
||||
}
|
||||
|
||||
impl Config {
|
||||
|
|
|
@ -144,6 +144,7 @@ pub fn parse_config(args: Vec<String>) -> Config {
|
|||
"enable this to generate a Rustfix coverage file, which is saved in \
|
||||
`./<build_base>/rustfix_missing_coverage.txt`",
|
||||
)
|
||||
.optflag("", "force-rerun", "rerun tests even if the inputs are unchanged")
|
||||
.optflag("h", "help", "show this message")
|
||||
.reqopt("", "channel", "current Rust channel", "CHANNEL");
|
||||
|
||||
|
@ -289,6 +290,8 @@ pub fn parse_config(args: Vec<String>) -> Config {
|
|||
llvm_components: matches.opt_str("llvm-components").unwrap(),
|
||||
nodejs: matches.opt_str("nodejs"),
|
||||
npm: matches.opt_str("npm"),
|
||||
|
||||
force_rerun: matches.opt_present("force-rerun"),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -644,6 +647,7 @@ fn make_test(config: &Config, testpaths: &TestPaths, inputs: &Stamp) -> Vec<test
|
|||
let test_name = crate::make_test_name(config, testpaths, revision);
|
||||
let mut desc = make_test_description(config, test_name, &test_path, src_file, cfg);
|
||||
// Ignore tests that already run and are up to date with respect to inputs.
|
||||
if !config.force_rerun {
|
||||
desc.ignore |= is_up_to_date(
|
||||
config,
|
||||
testpaths,
|
||||
|
@ -651,6 +655,7 @@ fn make_test(config: &Config, testpaths: &TestPaths, inputs: &Stamp) -> Vec<test
|
|||
revision.map(|s| s.as_str()),
|
||||
inputs,
|
||||
);
|
||||
}
|
||||
test::TestDescAndFn { desc, testfn: make_test_closure(config, testpaths, revision) }
|
||||
})
|
||||
.collect()
|
||||
|
|
Loading…
Reference in a new issue