File tree 4 files changed +34
-1
lines changed
4 files changed +34
-1
lines changed Original file line number Diff line number Diff line change 1
1
[build ]
2
- rustflags = " -C target-feature=+avx2 "
2
+ rustflags = " -C target-feature=+sse "
3
3
4
4
[alias ]
5
5
testall = " hack test --feature-powerset --skip default"
Original file line number Diff line number Diff line change @@ -18,6 +18,9 @@ cfg-if = "1.0.0"
18
18
lazy_static = " 1.4.0"
19
19
page_size = " 0.4.2"
20
20
21
+ [dev-dependencies ]
22
+ anyhow = " 1.0.57"
23
+
21
24
[features ]
22
25
default = [" simd" ]
23
26
simd = []
Original file line number Diff line number Diff line change @@ -65,6 +65,7 @@ aligners v0.0.1
65
65
#### Dev
66
66
67
67
- ` cargo-hack ` &ndash ; used for more robust testing by compiling and running the code for the feature powerset.
68
+ - ` anyhow ` &ndash ; used in the ` simd_alignment_test ` to make error handling easy.
68
69
69
70
## ` crev `
70
71
Original file line number Diff line number Diff line change
1
+ #[ cfg( feature = "simd" ) ]
2
+ mod tests {
3
+ use anyhow:: { bail, Result } ;
4
+
5
+ const EXPECTED_SWITCH_ENV_NAME : & str = "ALIGNERS_TEST_SIMD_EXPECTED_SIZE" ;
6
+
7
+ #[ test]
8
+ #[ ignore]
9
+ pub fn simd_alignment_test ( ) {
10
+ let verify = verify_simd_block_size ( ) ;
11
+ verify. unwrap ( ) ;
12
+ }
13
+
14
+ pub fn verify_simd_block_size ( ) -> Result < ( ) > {
15
+ use aligners:: alignment:: { Alignment , SimdBlock } ;
16
+ let expected_size: usize = std:: env:: var ( EXPECTED_SWITCH_ENV_NAME ) ?. parse ( ) ?;
17
+ let actual_size = SimdBlock :: size ( ) ;
18
+
19
+ if expected_size != actual_size {
20
+ bail ! (
21
+ "Expected SIMD block size was '{}', but actual is '{}'" ,
22
+ expected_size,
23
+ actual_size
24
+ ) ;
25
+ }
26
+
27
+ Ok ( ( ) )
28
+ }
29
+ }
You can’t perform that action at this time.
0 commit comments