@@ -77,19 +77,29 @@ impl<T: core::fmt::Debug + DefaultStrategy, const LANES: usize> DefaultStrategy
77
77
}
78
78
}
79
79
80
+ #[ cfg( not( miri) ) ]
81
+ fn make_runner ( ) -> proptest:: test_runner:: TestRunner {
82
+ Default :: default ( )
83
+ }
84
+ #[ cfg( miri) ]
85
+ fn make_runner ( ) -> proptest:: test_runner:: TestRunner {
86
+ // Only run a few tests on Miri
87
+ proptest:: test_runner:: TestRunner :: new ( proptest:: test_runner:: Config :: with_cases ( 4 ) )
88
+ }
89
+
80
90
/// Test a function that takes a single value.
81
91
pub fn test_1 < A : core:: fmt:: Debug + DefaultStrategy > (
82
92
f : & dyn Fn ( A ) -> proptest:: test_runner:: TestCaseResult ,
83
93
) {
84
- let mut runner = proptest :: test_runner :: TestRunner :: default ( ) ;
94
+ let mut runner = make_runner ( ) ;
85
95
runner. run ( & A :: default_strategy ( ) , f) . unwrap ( ) ;
86
96
}
87
97
88
98
/// Test a function that takes two values.
89
99
pub fn test_2 < A : core:: fmt:: Debug + DefaultStrategy , B : core:: fmt:: Debug + DefaultStrategy > (
90
100
f : & dyn Fn ( A , B ) -> proptest:: test_runner:: TestCaseResult ,
91
101
) {
92
- let mut runner = proptest :: test_runner :: TestRunner :: default ( ) ;
102
+ let mut runner = make_runner ( ) ;
93
103
runner
94
104
. run ( & ( A :: default_strategy ( ) , B :: default_strategy ( ) ) , |( a, b) | {
95
105
f ( a, b)
@@ -105,7 +115,7 @@ pub fn test_3<
105
115
> (
106
116
f : & dyn Fn ( A , B , C ) -> proptest:: test_runner:: TestCaseResult ,
107
117
) {
108
- let mut runner = proptest :: test_runner :: TestRunner :: default ( ) ;
118
+ let mut runner = make_runner ( ) ;
109
119
runner
110
120
. run (
111
121
& (
@@ -361,24 +371,28 @@ macro_rules! test_lanes {
361
371
362
372
#[ test]
363
373
#[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test:: wasm_bindgen_test) ]
374
+ #[ cfg( not( miri) ) ] // Miri intrinsic implementations are uniform and larger tests are sloooow
364
375
fn lanes_8( ) {
365
376
implementation:: <8 >( ) ;
366
377
}
367
378
368
379
#[ test]
369
380
#[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test:: wasm_bindgen_test) ]
381
+ #[ cfg( not( miri) ) ] // Miri intrinsic implementations are uniform and larger tests are sloooow
370
382
fn lanes_16( ) {
371
383
implementation:: <16 >( ) ;
372
384
}
373
385
374
386
#[ test]
375
387
#[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test:: wasm_bindgen_test) ]
388
+ #[ cfg( not( miri) ) ] // Miri intrinsic implementations are uniform and larger tests are sloooow
376
389
fn lanes_32( ) {
377
390
implementation:: <32 >( ) ;
378
391
}
379
392
380
393
#[ test]
381
394
#[ cfg_attr( target_arch = "wasm32" , wasm_bindgen_test:: wasm_bindgen_test) ]
395
+ #[ cfg( not( miri) ) ] // Miri intrinsic implementations are uniform and larger tests are sloooow
382
396
fn lanes_64( ) {
383
397
implementation:: <64 >( ) ;
384
398
}
0 commit comments