Skip to content

Commit

Permalink
Test with uwasi implementation (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
kateinoigakukun authored Jul 19, 2022
1 parent 901de66 commit 93f2dd5
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
- { os: ubuntu-20.04, toolchain: wasm-5.6.0-RELEASE, wasi-backend: Node }
- { os: ubuntu-20.04, toolchain: wasm-5.5.0-RELEASE, wasi-backend: Wasmer }
- { os: ubuntu-20.04, toolchain: wasm-5.6.0-RELEASE, wasi-backend: Wasmer }
- { os: ubuntu-20.04, toolchain: wasm-5.5.0-RELEASE, wasi-backend: MicroWASI }
- { os: ubuntu-20.04, toolchain: wasm-5.6.0-RELEASE, wasi-backend: MicroWASI }

runs-on: ${{ matrix.entry.os }}
steps:
Expand Down
16 changes: 16 additions & 0 deletions IntegrationTests/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ const SwiftRuntime = require("javascript-kit-swift").SwiftRuntime;
const WasmerWASI = require("@wasmer/wasi").WASI;
const WasmFs = require("@wasmer/wasmfs").WasmFs;
const NodeWASI = require("wasi").WASI;
const { WASI: MicroWASI, useAll } = require("uwasi");

const promisify = require("util").promisify;
const fs = require("fs");
Expand Down Expand Up @@ -43,6 +44,21 @@ const WASI = {
}
}
},
MicroWASI: () => {
const wasi = new MicroWASI({
args: [],
env: {},
features: [useAll()],
})

return {
wasiImport: wasi.wasiImport,
start(instance) {
wasi.initialize(instance);
instance.exports.main();
}
}
},
Node: () => {
const wasi = new NodeWASI({
args: [],
Expand Down
29 changes: 23 additions & 6 deletions IntegrationTests/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions IntegrationTests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"dependencies": {
"@wasmer/wasi": "^0.12.0",
"@wasmer/wasmfs": "^0.12.0",
"uwasi": "^1.0.0",
"javascript-kit-swift": "file:.."
}
}

0 comments on commit 93f2dd5

Please sign in to comment.