1 use wasmtime::*;
2 use wasmtime_test_macros::wasmtime_test;
3 
4 #[wasmtime_test(strategies(not(Cranelift)))]
5 #[cfg_attr(miri, ignore)]
6 fn ensure_compatibility_between_winch_and_table_lazy_init(config: &mut Config) -> Result<()> {
7     config.table_lazy_init(false);
8     let result = Engine::new(&config);
9     match result {
10         Ok(_) => {
11             anyhow::bail!("Expected incompatibility between the `table_lazy_init` option and Winch")
12         }
13         Err(e) => {
14             assert_eq!(
15                 e.to_string(),
16                 "Winch requires the table-lazy-init option to be enabled"
17             );
18         }
19     }
20 
21     Ok(())
22 }
23 
24 #[wasmtime_test(strategies(not(Cranelift)))]
25 #[cfg_attr(miri, ignore)]
26 fn ensure_compatibility_between_winch_and_signals_based_traps(config: &mut Config) -> Result<()> {
27     config.signals_based_traps(false);
28     let result = Engine::new(&config);
29     match result {
30         Ok(_) => {
31             anyhow::bail!(
32                 "Expected incompatibility between the `signals_based_traps` option and Winch"
33             )
34         }
35         Err(e) => {
36             assert_eq!(
37                 e.to_string(),
38                 "Winch requires the signals-based-traps option to be enabled"
39             );
40         }
41     }
42 
43     Ok(())
44 }
45 
46 #[wasmtime_test(strategies(not(Cranelift)))]
47 #[cfg_attr(miri, ignore)]
48 fn ensure_compatibility_between_winch_and_generate_native_debuginfo(
49     config: &mut Config,
50 ) -> Result<()> {
51     config.debug_info(true);
52     let result = Engine::new(&config);
53     match result {
54         Ok(_) => {
55             anyhow::bail!(
56                 "Expected incompatibility between the `generate_native_debuginfo` option and Winch"
57             )
58         }
59         Err(e) => {
60             assert_eq!(
61                 e.to_string(),
62                 "Winch does not currently support generating native debug information"
63             );
64         }
65     }
66 
67     Ok(())
68 }
69