From 1055263fc4d07bbc91eee204d29c3272f785b9f6 Mon Sep 17 00:00:00 2001 From: Mark Rousskov Date: Sun, 3 Mar 2019 10:37:31 -0700 Subject: [PATCH] Ignore should_panic tests on android These tests currently segfault sometimes. Android is a tier-2 target so this is fine to disable instead of fixing. Unfortunately, this isn't quite enough as rustdoc doesn't currently correctly interpret the --exclude-should-panic flag (i.e., ignores it). That proved to be harder to fix than I had time for so we're going to leave it and hope that at least some of the failures are fixed. --- src/bootstrap/config.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index d20958854ed6a..d17cc45e98757 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -650,6 +650,22 @@ impl Config { let default = config.channel == "dev"; config.ignore_git = ignore_git.unwrap_or(default); + // Disable should_panic tests on Android targets. Panic in tests currently means a potential + // segfault could occur on Android, which will spuriously fail our CI. + // + // See #55861 for more information. + if config.targets.iter().any(|target| target.contains("android")) { + if let Subcommand::Test { test_args, .. } | + Subcommand::Bench { test_args, .. } = &mut config.cmd { + if !test_args.contains(&String::from("-Zunstable-options")) { + test_args.push(String::from("-Zunstable-options")); + } + if !test_args.contains(&String::from("--exclude-should-panic")) { + test_args.push(String::from("--exclude-should-panic")); + } + } + } + config }