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

test: clean up wasm fixtures #25360

Merged
merged 1 commit into from
Jan 8, 2019
Merged
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
Binary file added test/fixtures/shared-memory.wasm
Binary file not shown.
8 changes: 8 additions & 0 deletions test/fixtures/shared-memory.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
;; Compiled using the WebAssembly Tootkit (https://github.com/WebAssembly/wabt)
;; $ wat2wasm --enable-threads shared-memory.wat -o shared-memory.wasm

(module
;; Create shared memory with initial 1 page (64KiB) and max 1 page
(memory $mem 1 1 shared)
(export "memory" (memory $mem))
)
Binary file added test/fixtures/simple.wasm
Binary file not shown.
11 changes: 11 additions & 0 deletions test/fixtures/simple.wat
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
;; Compiled using the WebAssembly Tootkit (https://github.com/WebAssembly/wabt)
;; $ wat2wasm simple.wat -o simple.wasm

(module
(func $add (param $a i32) (param $b i32) (result i32)
;; return $a + $b
(i32.add (get_local $a) (get_local $b))
)

(export "add" (func $add))
)
Binary file removed test/fixtures/test.wasm
Binary file not shown.
10 changes: 0 additions & 10 deletions test/fixtures/test.wat

This file was deleted.

Binary file removed test/fixtures/wasm-threads-shared-memory.wasm
Binary file not shown.
4 changes: 0 additions & 4 deletions test/fixtures/wasm-threads-shared-memory.wat

This file was deleted.

2 changes: 1 addition & 1 deletion test/parallel/test-util-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const { internalBinding } = require('internal/test/binding');
const { JSStream } = internalBinding('js_stream');

const external = (new JSStream())._externalStream;
const wasmBuffer = fixtures.readSync('test.wasm');
const wasmBuffer = fixtures.readSync('simple.wasm');

for (const [ value, _method ] of [
[ external, 'isExternal' ],
Expand Down
4 changes: 2 additions & 2 deletions test/parallel/test-v8-serdes.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const os = require('os');
const circular = {};
circular.circular = circular;

const wasmModule = new WebAssembly.Module(fixtures.readSync('test.wasm'));
const wasmModule = new WebAssembly.Module(fixtures.readSync('simple.wasm'));

const objects = [
{ foo: 'bar' },
Expand Down Expand Up @@ -238,5 +238,5 @@ const deserializerTypeError =
{
const deserializedWasmModule = v8.deserialize(v8.serialize(wasmModule));
const instance = new WebAssembly.Instance(deserializedWasmModule);
assert.strictEqual(instance.exports.addTwo(10, 20), 30);
assert.strictEqual(instance.exports.add(10, 20), 30);
}
4 changes: 2 additions & 2 deletions test/parallel/test-wasm-simple.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ require('../common');
const assert = require('assert');
const fixtures = require('../common/fixtures');

const buffer = fixtures.readSync('test.wasm');
const buffer = fixtures.readSync('simple.wasm');

assert.ok(WebAssembly.validate(buffer), 'Buffer should be valid WebAssembly');

WebAssembly.instantiate(buffer, {}).then((results) => {
// Exported function should add two numbers.
assert.strictEqual(
results.instance.exports.addTwo(10, 20),
results.instance.exports.add(10, 20),
30
);
});
4 changes: 2 additions & 2 deletions test/parallel/test-worker-message-port-wasm-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ const assert = require('assert');
const fixtures = require('../common/fixtures');

const { Worker } = require('worker_threads');
const wasmModule = new WebAssembly.Module(fixtures.readSync('test.wasm'));
const wasmModule = new WebAssembly.Module(fixtures.readSync('simple.wasm'));

const worker = new Worker(`
const { parentPort } = require('worker_threads');
parentPort.once('message', ({ wasmModule }) => {
const instance = new WebAssembly.Instance(wasmModule);
parentPort.postMessage(instance.exports.addTwo(10, 20));
parentPort.postMessage(instance.exports.add(10, 20));
});
`, { eval: true });

Expand Down
2 changes: 1 addition & 1 deletion test/parallel/test-worker-message-port-wasm-threads.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const { MessageChannel, Worker } = require('worker_threads');
// through MessageChannels (without crashing).

const fixtures = require('../common/fixtures');
const wasmSource = fixtures.readSync('wasm-threads-shared-memory.wasm');
const wasmSource = fixtures.readSync('shared-memory.wasm');
const wasmModule = new WebAssembly.Module(wasmSource);
const instance = new WebAssembly.Instance(wasmModule);

Expand Down