rustwasm / wasm-bindgen

Facilitating high-level interactions between Wasm modules and JavaScript
https://rustwasm.github.io/docs/wasm-bindgen/
Apache License 2.0
7.83k stars 1.08k forks source link

Test different CLI flags in reference tests #4264

Closed RunDevelopment closed 1 week ago

RunDevelopment commented 1 week ago

This PR adds the infrastructure for testing the code gen for different CLI flags, which is important for #4229 (and #4065). This is done using // FLAGS: --flag1 --flag2=value comments, which are passed directly to the CLI.

One hacky thing I had to do was to parse the --target option. This is necessary, because the target determines which files the reference test compares. E.g. bundler compares reference_test_bg.js while everything else compares reference_test.js (no _bg).