(
func: &tinywasm::Function,
store: &mut Store,
args: &[WasmValue],
)
| 641 | } |
| 642 | |
| 643 | fn exec_with_budget( |
| 644 | func: &tinywasm::Function, |
| 645 | store: &mut Store, |
| 646 | args: &[WasmValue], |
| 647 | ) -> Result<Vec<WasmValue>, tinywasm::Error> { |
| 648 | let mut exec = func.call_resumable(store, args)?; |
| 649 | for _ in 0..TEST_MAX_SUSPENSIONS { |
| 650 | match exec.resume_with_time_budget(TEST_TIME_SLICE)? { |
| 651 | ExecProgress::Completed(values) => return Ok(values), |
| 652 | ExecProgress::Suspended => {} |
| 653 | } |
| 654 | } |
| 655 | Err(tinywasm::Error::Other(format!( |
| 656 | "testsuite execution timed out after {} time slices of {:?}", |
| 657 | TEST_MAX_SUSPENSIONS, TEST_TIME_SLICE |
| 658 | ))) |
| 659 | } |
| 660 | |
| 661 | fn try_downcast_panic(panic: Box<dyn std::any::Any + Send>) -> String { |
| 662 | let info = panic.downcast_ref::<panic::PanicHookInfo>().map(ToString::to_string); |
no test coverage detected