Skip to content

Commit

Permalink
Add an env variable to ignore the arch-specific tests
Browse files Browse the repository at this point in the history
Use STDSIMD_TEST_NORUN=1 to disable them.
  • Loading branch information
lu-zero committed May 22, 2018
1 parent 59f31b5 commit 07d0cee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/simd-test-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() };
Expand Down

0 comments on commit 07d0cee

Please sign in to comment.