Travis,
/// The AppVeyor environment, for Windows builds.
AppVeyor,
+ /// The Azure Pipelines environment, for Linux (including Docker), Windows, and macOS builds.
+ AzurePipelines,
}
impl CiEnv {
CiEnv::Travis
} else if env::var("APPVEYOR").ok().map_or(false, |e| &*e == "True") {
CiEnv::AppVeyor
+ } else if env::var("TF_BUILD").ok().map_or(false, |e| &*e == "True") {
+ CiEnv::AzurePipelines
} else {
CiEnv::None
}
}
}
}
+
+pub fn forcing_clang_based_tests() -> bool {
+ if let Some(var) = env::var_os("RUSTBUILD_FORCE_CLANG_BASED_TESTS") {
+ match &var.to_string_lossy().to_lowercase()[..] {
+ "1" | "yes" | "on" => true,
+ "0" | "no" | "off" => false,
+ other => {
+ // Let's make sure typos don't go unnoticed
+ panic!("Unrecognized option '{}' set in \
+ RUSTBUILD_FORCE_CLANG_BASED_TESTS", other)
+ }
+ }
+ } else {
+ false
+ }
+}