Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate dwarf for tests by default #4435

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions crates/cli/src/bin/wasm-bindgen-test-runner/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,12 +117,17 @@ fn main() -> anyhow::Result<()> {
.map(Path::new)
.context("file to test is not a valid file, can't extract file name")?;

let debug = env::var("WASM_BINDGEN_NO_DEBUG").is_err();

// Collect all tests that the test harness is supposed to run. We assume
// that any exported function with the prefix `__wbg_test` is a test we need
// to execute.
let wasm = fs::read(&cli.file).context("failed to read Wasm file")?;
let mut wasm =
walrus::Module::from_buffer(&wasm).context("failed to deserialize Wasm module")?;
let mut wasm = walrus::ModuleConfig::new()
// generate dwarf for debug
.generate_dwarf(debug)
.parse(&wasm)
.context("failed to deserialize Wasm module")?;
let mut tests = Tests::new();

'outer: for export in wasm.exports.iter() {
Expand Down Expand Up @@ -233,7 +238,6 @@ fn main() -> anyhow::Result<()> {
};

let headless = env::var("NO_HEADLESS").is_err();
let debug = env::var("WASM_BINDGEN_NO_DEBUG").is_err();

// Gracefully handle requests to execute only node or only web tests.
let node = matches!(test_mode, TestMode::Node { .. });
Expand Down Expand Up @@ -306,7 +310,6 @@ fn main() -> anyhow::Result<()> {

b.debug(debug)
.input_module(module, wasm)
.keep_debug(false)
.emit_start(false)
.generate(&tmpdir)
.context("executing `wasm-bindgen` over the Wasm file")?;
Expand Down
Loading