Skip to content

Commit 93f2dd5

Browse files
Test with uwasi implementation (#198)
1 parent 901de66 commit 93f2dd5

File tree

4 files changed

+42
-6
lines changed

4 files changed

+42
-6
lines changed

.github/workflows/test.yml

+2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ jobs:
2020
- { os: ubuntu-20.04, toolchain: wasm-5.6.0-RELEASE, wasi-backend: Node }
2121
- { os: ubuntu-20.04, toolchain: wasm-5.5.0-RELEASE, wasi-backend: Wasmer }
2222
- { os: ubuntu-20.04, toolchain: wasm-5.6.0-RELEASE, wasi-backend: Wasmer }
23+
- { os: ubuntu-20.04, toolchain: wasm-5.5.0-RELEASE, wasi-backend: MicroWASI }
24+
- { os: ubuntu-20.04, toolchain: wasm-5.6.0-RELEASE, wasi-backend: MicroWASI }
2325

2426
runs-on: ${{ matrix.entry.os }}
2527
steps:

IntegrationTests/lib.js

+16
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ const SwiftRuntime = require("javascript-kit-swift").SwiftRuntime;
22
const WasmerWASI = require("@wasmer/wasi").WASI;
33
const WasmFs = require("@wasmer/wasmfs").WasmFs;
44
const NodeWASI = require("wasi").WASI;
5+
const { WASI: MicroWASI, useAll } = require("uwasi");
56

67
const promisify = require("util").promisify;
78
const fs = require("fs");
@@ -43,6 +44,21 @@ const WASI = {
4344
}
4445
}
4546
},
47+
MicroWASI: () => {
48+
const wasi = new MicroWASI({
49+
args: [],
50+
env: {},
51+
features: [useAll()],
52+
})
53+
54+
return {
55+
wasiImport: wasi.wasiImport,
56+
start(instance) {
57+
wasi.initialize(instance);
58+
instance.exports.main();
59+
}
60+
}
61+
},
4662
Node: () => {
4763
const wasi = new NodeWASI({
4864
args: [],

IntegrationTests/package-lock.json

+23-6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

IntegrationTests/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"dependencies": {
44
"@wasmer/wasi": "^0.12.0",
55
"@wasmer/wasmfs": "^0.12.0",
6+
"uwasi": "^1.0.0",
67
"javascript-kit-swift": "file:.."
78
}
89
}

0 commit comments

Comments
 (0)