Add an env variable to ignore the arch-specific tests

Use STDSIMD_TEST_NORUN=1 to disable them.
This commit is contained in:
Luca Barbato
2018-05-22 15:33:57 +00:00
committed by gnzlbg
parent a1955afb47
commit c01982348e

View File

@@ -101,10 +101,18 @@ pub fn simd_test(
let q = quote!{ true };
q.to_tokens(&mut cfg_target_features);
let test_norun = std::env::var("STDSIMD_TEST_NORUN").is_ok();
let maybe_ignore = if !test_norun {
TokenStream::empty()
} else {
(quote! { #[ignore] }).into()
};
let ret: TokenStream = quote_spanned! {
proc_macro2::Span::call_site() =>
#[allow(non_snake_case)]
#[test]
#maybe_ignore
fn #name() {
if #force_test | (#cfg_target_features) {
return unsafe { #name() };