Skip to content

Commit

Permalink
Wasmtime: test that disabling backtraces disables unwind_info
Browse files Browse the repository at this point in the history
  • Loading branch information
Stebalien committed Jun 29, 2022
1 parent 4f609f7 commit 61312a9
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions crates/wasmtime/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,8 +519,10 @@ impl Default for Engine {
#[cfg(test)]
mod tests {
use crate::{Config, Engine, Module, OptLevel};

use anyhow::Result;
use tempfile::TempDir;
use wasmtime_environ::FlagValue;

#[test]
fn cache_accounts_for_opt_level() -> Result<()> {
Expand Down Expand Up @@ -585,4 +587,20 @@ mod tests {

Ok(())
}

#[test]
#[cfg(compiler)]
fn test_disable_backtraces() {
let engine = Engine::new(
Config::new()
.wasm_backtrace(false)
.wasm_reference_types(false),
)
.expect("failed to construct engine");
assert_eq!(
engine.compiler().flags().get("unwind_info"),
Some(&FlagValue::Bool(false)),
"unwind info should be disabled unless needed"
);
}
}

0 comments on commit 61312a9

Please sign in to comment.