Skip to content

Commit f85bd24

Browse files
Merge pull request rust-lang#72 from rust-lang/feature/proptest
proptest This replaces most tests with proptest, and makes it easier to define tests generically over lane count. This should provide much broader API coverage and give us more confidence in our implementation.
2 parents d3c58da + 2b3f4b2 commit f85bd24

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+1042
-1639
lines changed

.travis.yml

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
branches:
2+
only:
3+
- master
4+
15
language: rust
26
rust:
37
- nightly

Cargo.toml

+1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@
22

33
members = [
44
"crates/core_simd",
5+
"crates/test_helpers",
56
]

crates/core_simd/Cargo.toml

+8
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,11 @@ version = "0.2"
1414

1515
[dev-dependencies.wasm-bindgen-test]
1616
version = "0.3"
17+
18+
[dev-dependencies.proptest]
19+
version = "0.10"
20+
default-features = false
21+
features = ["alloc"]
22+
23+
[dev-dependencies.test_helpers]
24+
path = "../test_helpers"

crates/core_simd/src/macros.rs

+6
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,12 @@ macro_rules! impl_vector {
141141
}
142142
}
143143

144+
impl <const LANES: usize> From<$name<LANES>> for [$type; LANES] where $name<LANES>: crate::LanesAtMost64 {
145+
fn from(vector: $name<LANES>) -> Self {
146+
vector.to_array()
147+
}
148+
}
149+
144150
// splat
145151
impl<const LANES: usize> From<$type> for $name<LANES> where Self: crate::LanesAtMost64 {
146152
#[inline]

crates/core_simd/tests/f32_ops.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#[macro_use]
2+
mod ops_macros;
3+
impl_float_tests! { SimdF32, f32, i32 }

crates/core_simd/tests/f64_ops.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#[macro_use]
2+
mod ops_macros;
3+
impl_float_tests! { SimdF64, f64, i64 }

crates/core_simd/tests/helpers/biteq.rs

-120
This file was deleted.

crates/core_simd/tests/helpers/lanewise.rs

-61
This file was deleted.

crates/core_simd/tests/helpers/mod.rs

-4
This file was deleted.

crates/core_simd/tests/i128_ops.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#[macro_use]
2+
mod ops_macros;
3+
impl_signed_tests! { SimdI128, i128 }

crates/core_simd/tests/i16_ops.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#[macro_use]
2+
mod ops_macros;
3+
impl_signed_tests! { SimdI16, i16 }

crates/core_simd/tests/i32_ops.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#[macro_use]
2+
mod ops_macros;
3+
impl_signed_tests! { SimdI32, i32 }

crates/core_simd/tests/i64_ops.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#[macro_use]
2+
mod ops_macros;
3+
impl_signed_tests! { SimdI64, i64 }

crates/core_simd/tests/i8_ops.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#[macro_use]
2+
mod ops_macros;
3+
impl_signed_tests! { SimdI8, i8 }

crates/core_simd/tests/isize_ops.rs

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#[macro_use]
2+
mod ops_macros;
3+
impl_signed_tests! { SimdIsize, isize }

crates/core_simd/tests/mask_ops.rs

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
mod mask_ops_impl;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#[macro_use]
2+
mod mask_macros;
3+
4+
mod mask8;
5+
mod mask16;
6+
mod mask32;
7+
mod mask64;
8+
mod mask128;
9+
mod masksize;

crates/core_simd/tests/ops.rs

-1
This file was deleted.

crates/core_simd/tests/ops_impl/f32.rs

-6
This file was deleted.

crates/core_simd/tests/ops_impl/f64.rs

-5
This file was deleted.

0 commit comments

Comments
 (0)