Skip to content

Commit

Permalink
fix tests with features
Browse files Browse the repository at this point in the history
  • Loading branch information
gnzlbg committed Aug 20, 2018
1 parent 8f3f4df commit 41e937e
Show file tree
Hide file tree
Showing 7 changed files with 24 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/api/into_bits/v128.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! `FromBits` and `IntoBits` implementations for portable 128-bit wide vectors
#![cfg_attr(rustfmt, rustfmt_skip)]

#[allow(unused)] // wasm_bindgen_test
use crate::*;
use crate::v128::*;

impl_from_bits!(i8x16[test_v128]: u8x16, m8x16, i16x8, u16x8, m16x8, i32x4, u32x4, f32x4, m32x4, i64x2, u64x2, f64x2, m64x2, i128x1, u128x1, m128x1);
Expand Down
2 changes: 2 additions & 0 deletions src/api/into_bits/v16.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! `FromBits` and `IntoBits` implementations for portable 16-bit wide vectors
#![cfg_attr(rustfmt, rustfmt_skip)]

#[allow(unused)] // wasm_bindgen_test
use crate::*;
use crate::v16::*;

impl_from_bits!(i8x2[test_v16]: u8x2, m8x2);
Expand Down
2 changes: 2 additions & 0 deletions src/api/into_bits/v256.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! `FromBits` and `IntoBits` implementations for portable 256-bit wide vectors
#![cfg_attr(rustfmt, rustfmt_skip)]

#[allow(unused)] // wasm_bindgen_test
use crate::*;
use crate::v256::*;

impl_from_bits!(i8x32[test_v256]: u8x32, m8x32, i16x16, u16x16, m16x16, i32x8, u32x8, f32x8, m32x8, i64x4, u64x4, f64x4, m64x4, i128x2, u128x2, m128x2);
Expand Down
2 changes: 2 additions & 0 deletions src/api/into_bits/v32.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! `FromBits` and `IntoBits` implementations for portable 32-bit wide vectors
#![cfg_attr(rustfmt, rustfmt_skip)]

#[allow(unused)] // wasm_bindgen_test
use crate::*;
use crate::v32::*;

impl_from_bits!(i8x4[test_v32]: u8x4, m8x4, i16x2, u16x2, m16x2);
Expand Down
2 changes: 2 additions & 0 deletions src/api/into_bits/v512.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! `FromBits` and `IntoBits` implementations for portable 512-bit wide vectors
#![cfg_attr(rustfmt, rustfmt_skip)]

#[allow(unused)] // wasm_bindgen_test
use crate::*;
use crate::v512::*;

impl_from_bits!(i8x64[test_v512]: u8x64, m8x64, i16x32, u16x32, m16x32, i32x16, u32x16, f32x16, m32x16, i64x8, u64x8, f64x8, m64x8, i128x4, u128x4, m128x4);
Expand Down
2 changes: 2 additions & 0 deletions src/api/into_bits/v64.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
//! `FromBits` and `IntoBits` implementations for portable 64-bit wide vectors
#![cfg_attr(rustfmt, rustfmt_skip)]

#[allow(unused)] // wasm_bindgen_test
use crate::*;
use crate::v64::*;

impl_from_bits!(i8x8[test_v64]: u8x8, m8x8, i16x4, u16x4, m16x4, i32x2, u32x2, f32x2, m32x2);
Expand Down
18 changes: 12 additions & 6 deletions tests/endianness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use wasm_bindgen_test::*;
use packed_simd::*;
use std::{mem, slice};

#[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
#[cfg_attr(not(target_arch = "wasm32"), test)]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn endian_indexing() {
let v = i32x4::new(0, 1, 2, 3);
assert_eq!(v.extract(0), 0);
Expand All @@ -18,7 +19,8 @@ fn endian_indexing() {
assert_eq!(v.extract(3), 3);
}

#[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
#[cfg_attr(not(target_arch = "wasm32"), test)]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn endian_bitcasts() {
#[cfg_attr(rustfmt, rustfmt_skip)]
let x = i8x16::new(
Expand All @@ -34,7 +36,8 @@ fn endian_bitcasts() {
assert_eq!(t, e);
}

#[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
#[cfg_attr(not(target_arch = "wasm32"), test)]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn endian_casts() {
#[cfg_attr(rustfmt, rustfmt_skip)]
let x = i8x16::new(
Expand All @@ -50,7 +53,8 @@ fn endian_casts() {
assert_eq!(t, e);
}

#[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
#[cfg_attr(not(target_arch = "wasm32"), test)]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn endian_load_and_stores() {
#[cfg_attr(rustfmt, rustfmt_skip)]
let x = i8x16::new(
Expand All @@ -75,7 +79,8 @@ fn endian_load_and_stores() {
assert_eq!(z, x);
}

#[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
#[cfg_attr(not(target_arch = "wasm32"), test)]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn endian_array_union() {
union A {
data: [f32; 4],
Expand Down Expand Up @@ -144,7 +149,8 @@ fn endian_array_union() {
assert_eq!(x, e);
}

#[cfg_attr(not(target_arch = "wasm32"), test)] #[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
#[cfg_attr(not(target_arch = "wasm32"), test)]
#[cfg_attr(target_arch = "wasm32", wasm_bindgen_test)]
fn endian_tuple_access() {
type F32x4T = (f32, f32, f32, f32);
union A {
Expand Down

0 comments on commit 41e937e

Please sign in to comment.