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

Fix CI #3460

Merged
merged 1 commit into from
Jun 5, 2023
Merged

Fix CI #3460

Show file tree
Hide file tree
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: 9 additions & 2 deletions crates/cli/tests/reference.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use std::process::Command;
use walrus::ModuleConfig;

fn main() -> Result<()> {
let filter = env::args().nth(1);
Expand Down Expand Up @@ -93,7 +94,11 @@ fn runtest(test: &Path) -> Result<()> {
.join("reference_test.wasm");

let mut bindgen = Command::cargo_bin("wasm-bindgen")?;
bindgen.arg("--out-dir").arg(td.path()).arg(&wasm);
bindgen
.arg("--out-dir")
.arg(td.path())
.arg(&wasm)
.arg("--remove-producers-section");
if contents.contains("// enable-externref") {
bindgen.env("WASM_BINDGEN_EXTERNREF", "1");
}
Expand Down Expand Up @@ -125,7 +130,9 @@ fn sanitize_wasm(wasm: &Path) -> Result<String> {
// Clean up the wasm module by removing all function
// implementations/instructions, data sections, etc. This'll help us largely
// only deal with exports/imports which is all we're really interested in.
let mut module = walrus::Module::from_file(wasm)?;
let mut module = ModuleConfig::new()
.generate_producers_section(false)
.parse_file(wasm)?;
for func in module.funcs.iter_mut() {
let local = match &mut func.kind {
walrus::FunctionKind::Local(l) => l,
Expand Down
5 changes: 4 additions & 1 deletion crates/externref-xform/tests/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use rayon::prelude::*;
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use walrus::ModuleConfig;
use wast::parser::{Parse, Parser};

fn main() {
Expand All @@ -19,7 +20,9 @@ fn main() {

fn runtest(test: &Test) -> Result<String> {
let wasm = wat::parse_file(&test.file)?;
let mut walrus = walrus::Module::from_buffer(&wasm)?;
let mut walrus = ModuleConfig::new()
.generate_producers_section(false)
.parse(&wasm)?;
let mut cx = wasm_bindgen_externref_xform::Context::default();
cx.prepare(&mut walrus)?;
for directive in test.directives.iter() {
Expand Down
5 changes: 4 additions & 1 deletion crates/multi-value-xform/tests/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use rayon::prelude::*;
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use walrus::ModuleConfig;
use wast::parser::{Parse, Parser};

fn main() {
Expand All @@ -19,7 +20,9 @@ fn main() {

fn runtest(test: &Test) -> Result<String> {
let wasm = wat::parse_file(&test.file)?;
let mut walrus = walrus::Module::from_buffer(&wasm)?;
let mut walrus = ModuleConfig::new()
.generate_producers_section(false)
.parse(&wasm)?;
let mut exports = Vec::new();
let mut xforms = Vec::new();
for directive in test.directives.iter() {
Expand Down
5 changes: 4 additions & 1 deletion crates/threads-xform/tests/all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,17 @@ use rayon::prelude::*;
use std::env;
use std::fs;
use std::path::{Path, PathBuf};
use walrus::ModuleConfig;

fn main() {
run("tests".as_ref(), runtest);
}

fn runtest(test: &Test) -> Result<String> {
let wasm = wat::parse_file(&test.file)?;
let mut module = walrus::Module::from_buffer(&wasm)?;
let mut module = ModuleConfig::new()
.generate_producers_section(false)
.parse(&wasm)?;

let config = wasm_bindgen_threads_xform::Config::new();

Expand Down
6 changes: 5 additions & 1 deletion crates/wasm-interpreter/tests/smoke.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
use walrus::ModuleConfig;
use wasm_bindgen_wasm_interpreter::Interpreter;

fn interpret(wat: &str, name: &str, result: Option<&[u32]>) {
let wasm = wat::parse_str(wat).unwrap();
let module = walrus::Module::from_buffer(&wasm).unwrap();
let mut module = ModuleConfig::new()
.generate_producers_section(false)
.parse(&wasm)
.unwrap();
let mut i = Interpreter::new(&module).unwrap();
let id = module
.exports
Expand Down