@@ -15,6 +15,7 @@ use crate::{WasmExecutionMethod, call_in_wasm};
1515type TestExternalities = CoreTestExternalities < Blake2Hasher , u64 > ;
1616
1717#[ test_case( WasmExecutionMethod :: Interpreted ) ]
18+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
1819fn returning_should_work ( wasm_method : WasmExecutionMethod ) {
1920 let mut ext = TestExternalities :: default ( ) ;
2021 let mut ext = ext. ext ( ) ;
@@ -32,6 +33,7 @@ fn returning_should_work(wasm_method: WasmExecutionMethod) {
3233}
3334
3435#[ test_case( WasmExecutionMethod :: Interpreted ) ]
36+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
3537fn panicking_should_work ( wasm_method : WasmExecutionMethod ) {
3638 let mut ext = TestExternalities :: default ( ) ;
3739 let mut ext = ext. ext ( ) ;
@@ -69,6 +71,7 @@ fn panicking_should_work(wasm_method: WasmExecutionMethod) {
6971}
7072
7173#[ test_case( WasmExecutionMethod :: Interpreted ) ]
74+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
7275fn storage_should_work ( wasm_method : WasmExecutionMethod ) {
7376 let mut ext = TestExternalities :: default ( ) ;
7477
@@ -98,6 +101,7 @@ fn storage_should_work(wasm_method: WasmExecutionMethod) {
98101}
99102
100103#[ test_case( WasmExecutionMethod :: Interpreted ) ]
104+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
101105fn clear_prefix_should_work ( wasm_method : WasmExecutionMethod ) {
102106 let mut ext = TestExternalities :: default ( ) ;
103107 {
@@ -131,6 +135,7 @@ fn clear_prefix_should_work(wasm_method: WasmExecutionMethod) {
131135}
132136
133137#[ test_case( WasmExecutionMethod :: Interpreted ) ]
138+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
134139fn blake2_256_should_work ( wasm_method : WasmExecutionMethod ) {
135140 let mut ext = TestExternalities :: default ( ) ;
136141 let mut ext = ext. ext ( ) ;
@@ -160,6 +165,7 @@ fn blake2_256_should_work(wasm_method: WasmExecutionMethod) {
160165}
161166
162167#[ test_case( WasmExecutionMethod :: Interpreted ) ]
168+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
163169fn blake2_128_should_work ( wasm_method : WasmExecutionMethod ) {
164170 let mut ext = TestExternalities :: default ( ) ;
165171 let mut ext = ext. ext ( ) ;
@@ -189,6 +195,7 @@ fn blake2_128_should_work(wasm_method: WasmExecutionMethod) {
189195}
190196
191197#[ test_case( WasmExecutionMethod :: Interpreted ) ]
198+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
192199fn twox_256_should_work ( wasm_method : WasmExecutionMethod ) {
193200 let mut ext = TestExternalities :: default ( ) ;
194201 let mut ext = ext. ext ( ) ;
@@ -222,6 +229,7 @@ fn twox_256_should_work(wasm_method: WasmExecutionMethod) {
222229}
223230
224231#[ test_case( WasmExecutionMethod :: Interpreted ) ]
232+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
225233fn twox_128_should_work ( wasm_method : WasmExecutionMethod ) {
226234 let mut ext = TestExternalities :: default ( ) ;
227235 let mut ext = ext. ext ( ) ;
@@ -251,6 +259,7 @@ fn twox_128_should_work(wasm_method: WasmExecutionMethod) {
251259}
252260
253261#[ test_case( WasmExecutionMethod :: Interpreted ) ]
262+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
254263fn ed25519_verify_should_work ( wasm_method : WasmExecutionMethod ) {
255264 let mut ext = TestExternalities :: default ( ) ;
256265 let mut ext = ext. ext ( ) ;
@@ -292,6 +301,7 @@ fn ed25519_verify_should_work(wasm_method: WasmExecutionMethod) {
292301}
293302
294303#[ test_case( WasmExecutionMethod :: Interpreted ) ]
304+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
295305fn sr25519_verify_should_work ( wasm_method : WasmExecutionMethod ) {
296306 let mut ext = TestExternalities :: default ( ) ;
297307 let mut ext = ext. ext ( ) ;
@@ -333,6 +343,7 @@ fn sr25519_verify_should_work(wasm_method: WasmExecutionMethod) {
333343}
334344
335345#[ test_case( WasmExecutionMethod :: Interpreted ) ]
346+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
336347fn ordered_trie_root_should_work ( wasm_method : WasmExecutionMethod ) {
337348 let mut ext = TestExternalities :: default ( ) ;
338349 let mut ext = ext. ext ( ) ;
@@ -352,6 +363,7 @@ fn ordered_trie_root_should_work(wasm_method: WasmExecutionMethod) {
352363}
353364
354365#[ test_case( WasmExecutionMethod :: Interpreted ) ]
366+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
355367fn offchain_local_storage_should_work ( wasm_method : WasmExecutionMethod ) {
356368 use substrate_client:: backend:: OffchainStorage ;
357369
@@ -375,6 +387,7 @@ fn offchain_local_storage_should_work(wasm_method: WasmExecutionMethod) {
375387}
376388
377389#[ test_case( WasmExecutionMethod :: Interpreted ) ]
390+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
378391fn offchain_http_should_work ( wasm_method : WasmExecutionMethod ) {
379392 let mut ext = TestExternalities :: default ( ) ;
380393 let ( offchain, state) = testing:: TestOffchainExt :: new ( ) ;
@@ -414,6 +427,7 @@ mod sandbox {
414427 use wabt;
415428
416429 #[ test_case( WasmExecutionMethod :: Interpreted ) ]
430+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
417431 fn sandbox_should_work ( wasm_method : WasmExecutionMethod ) {
418432 let mut ext = TestExternalities :: default ( ) ;
419433 let mut ext = ext. ext ( ) ;
@@ -454,6 +468,7 @@ mod sandbox {
454468 }
455469
456470 #[ test_case( WasmExecutionMethod :: Interpreted ) ]
471+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
457472 fn sandbox_trap ( wasm_method : WasmExecutionMethod ) {
458473 let mut ext = TestExternalities :: default ( ) ;
459474 let mut ext = ext. ext ( ) ;
@@ -483,6 +498,7 @@ mod sandbox {
483498 }
484499
485500 #[ test_case( WasmExecutionMethod :: Interpreted ) ]
501+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
486502 fn sandbox_should_trap_when_heap_exhausted ( wasm_method : WasmExecutionMethod ) {
487503 let mut ext = TestExternalities :: default ( ) ;
488504 let mut ext = ext. ext ( ) ;
@@ -513,6 +529,7 @@ mod sandbox {
513529 }
514530
515531 #[ test_case( WasmExecutionMethod :: Interpreted ) ]
532+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
516533 fn start_called ( wasm_method : WasmExecutionMethod ) {
517534 let mut ext = TestExternalities :: default ( ) ;
518535 let mut ext = ext. ext ( ) ;
@@ -559,6 +576,7 @@ mod sandbox {
559576 }
560577
561578 #[ test_case( WasmExecutionMethod :: Interpreted ) ]
579+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
562580 fn invoke_args ( wasm_method : WasmExecutionMethod ) {
563581 let mut ext = TestExternalities :: default ( ) ;
564582 let mut ext = ext. ext ( ) ;
@@ -601,6 +619,7 @@ mod sandbox {
601619 }
602620
603621 #[ test_case( WasmExecutionMethod :: Interpreted ) ]
622+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
604623 fn return_val ( wasm_method : WasmExecutionMethod ) {
605624 let mut ext = TestExternalities :: default ( ) ;
606625 let mut ext = ext. ext ( ) ;
@@ -631,6 +650,7 @@ mod sandbox {
631650 }
632651
633652 #[ test_case( WasmExecutionMethod :: Interpreted ) ]
653+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
634654 fn unlinkable_module ( wasm_method : WasmExecutionMethod ) {
635655 let mut ext = TestExternalities :: default ( ) ;
636656 let mut ext = ext. ext ( ) ;
@@ -659,6 +679,7 @@ mod sandbox {
659679 }
660680
661681 #[ test_case( WasmExecutionMethod :: Interpreted ) ]
682+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
662683 fn corrupted_module ( wasm_method : WasmExecutionMethod ) {
663684 let mut ext = TestExternalities :: default ( ) ;
664685 let mut ext = ext. ext ( ) ;
@@ -681,6 +702,7 @@ mod sandbox {
681702 }
682703
683704 #[ test_case( WasmExecutionMethod :: Interpreted ) ]
705+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
684706 fn start_fn_ok ( wasm_method : WasmExecutionMethod ) {
685707 let mut ext = TestExternalities :: default ( ) ;
686708 let mut ext = ext. ext ( ) ;
@@ -712,6 +734,7 @@ mod sandbox {
712734 }
713735
714736 #[ test_case( WasmExecutionMethod :: Interpreted ) ]
737+ #[ cfg_attr( feature = "wasmtime" , test_case( WasmExecutionMethod :: Compiled ) ) ]
715738 fn start_fn_traps ( wasm_method : WasmExecutionMethod ) {
716739 let mut ext = TestExternalities :: default ( ) ;
717740 let mut ext = ext. ext ( ) ;
0 commit comments