Skip to content

Commit eb9d9f2

Browse files
Add arg0 to wasi arguments because XCTest reads process arguments
and it expects at least having one argument
1 parent d82c70f commit eb9d9f2

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

Diff for: IntegrationTests/lib.js

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const fs = require("fs");
99
const readFile = promisify(fs.readFile);
1010

1111
const WASI = {
12-
Wasmer: () => {
12+
Wasmer: ({ programName }) => {
1313
// Instantiate a new WASI Instance
1414
const wasmFs = new WasmFs();
1515
// Output stdout and stderr to console
@@ -27,7 +27,7 @@ const WASI = {
2727
return originalWriteSync(fd, buffer, offset, length, position);
2828
};
2929
const wasi = new WasmerWASI({
30-
args: [],
30+
args: [programName],
3131
env: {},
3232
bindings: {
3333
...WasmerWASI.defaultBindings,
@@ -44,9 +44,9 @@ const WASI = {
4444
}
4545
}
4646
},
47-
MicroWASI: () => {
47+
MicroWASI: ({ programName }) => {
4848
const wasi = new MicroWASI({
49-
args: [],
49+
args: [programName],
5050
env: {},
5151
features: [useAll()],
5252
})
@@ -59,9 +59,9 @@ const WASI = {
5959
}
6060
}
6161
},
62-
Node: () => {
62+
Node: ({ programName }) => {
6363
const wasi = new NodeWASI({
64-
args: [],
64+
args: [programName],
6565
env: {},
6666
returnOnExit: true,
6767
})
@@ -91,7 +91,7 @@ const startWasiTask = async (wasmPath, wasiConstructor = selectWASIBackend()) =>
9191
const swift = new SwiftRuntime();
9292
// Fetch our Wasm File
9393
const wasmBinary = await readFile(wasmPath);
94-
const wasi = wasiConstructor();
94+
const wasi = wasiConstructor({ programName: wasmPath });
9595

9696
// Instantiate the WebAssembly file
9797
let { instance } = await WebAssembly.instantiate(wasmBinary, {

0 commit comments

Comments
 (0)