Skip to content

Commit cada852

Browse files
committed
[MERGE #5887 @Cellule] WebAssembly spec tests harness improvements
Merge pull request #5887 from Cellule:users/micfer/wasm-spec Use json5 to be able to document convert-test-suite/config.json5 with comments include/exclude relevant files in the wasm spec js-api testsuite Shim WebAssembly.Global so some test don't crash the test harness <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/microsoft/chakracore/5887) <!-- Reviewable:end -->
2 parents cc26df0 + ea789a3 commit cada852

File tree

12 files changed

+202
-105
lines changed

12 files changed

+202
-105
lines changed
Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
Harness Status: OK
2-
Found 36 tests: Fail = 32 Pass = 4
3-
Fail name Object expected
4-
Fail length Object expected
5-
Pass No arguments
2+
Found 36 tests: Fail = 35 Pass = 1
3+
Fail name assert_equals: WebAssembly.Global name should be Global expected "Global" but got ""
4+
Fail length assert_equals: WebAssembly.Global length should be 1 expected 1 but got 0
5+
Fail No arguments assert_throws: function "() => new WebAssembly.Global()" did not throw
66
Pass Calling
7-
Fail Order of evaluation Object doesn't support this action
8-
Pass Invalid descriptor argument
9-
Pass Invalid type argument
10-
Fail i64 with default Object doesn't support this action
11-
Fail Default value for type i32 Object doesn't support this action
12-
Fail Explicit value undefined for type i32 Object doesn't support this action
13-
Fail Explicit value null for type i32 Object doesn't support this action
14-
Fail Explicit value true for type i32 Object doesn't support this action
15-
Fail Explicit value false for type i32 Object doesn't support this action
16-
Fail Explicit value 2 for type i32 Object doesn't support this action
17-
Fail Explicit value "3" for type i32 Object doesn't support this action
18-
Fail Explicit value object with toString for type i32 Object doesn't support this action
19-
Fail Explicit value object with valueOf for type i32 Object doesn't support this action
20-
Fail Default value for type f32 Object doesn't support this action
21-
Fail Explicit value undefined for type f32 Object doesn't support this action
22-
Fail Explicit value null for type f32 Object doesn't support this action
23-
Fail Explicit value true for type f32 Object doesn't support this action
24-
Fail Explicit value false for type f32 Object doesn't support this action
25-
Fail Explicit value 2 for type f32 Object doesn't support this action
26-
Fail Explicit value "3" for type f32 Object doesn't support this action
27-
Fail Explicit value object with toString for type f32 Object doesn't support this action
28-
Fail Explicit value object with valueOf for type f32 Object doesn't support this action
29-
Fail Default value for type f64 Object doesn't support this action
30-
Fail Explicit value undefined for type f64 Object doesn't support this action
31-
Fail Explicit value null for type f64 Object doesn't support this action
32-
Fail Explicit value true for type f64 Object doesn't support this action
33-
Fail Explicit value false for type f64 Object doesn't support this action
34-
Fail Explicit value 2 for type f64 Object doesn't support this action
35-
Fail Explicit value "3" for type f64 Object doesn't support this action
36-
Fail Explicit value object with toString for type f64 Object doesn't support this action
37-
Fail Explicit value object with valueOf for type f64 Object doesn't support this action
38-
Fail Stray argument Object doesn't support this action
7+
Fail Order of evaluation assert_array_equals: lengths differ, expected 4 got 0
8+
Fail Invalid descriptor argument assert_throws: new Global(undefined) function "() => new WebAssembly.Global(invalidArgument)" did not throw
9+
Fail Invalid type argument assert_throws: function "() => new WebAssembly.Global(argument)" did not throw
10+
Fail i64 with default assert_throws: function "() => global.value" did not throw
11+
Fail Default value for type i32 assert_equals: value expected (number) 0 but got (undefined) undefined
12+
Fail Explicit value undefined for type i32 assert_equals: value expected (number) 0 but got (undefined) undefined
13+
Fail Explicit value null for type i32 assert_equals: value expected (number) 0 but got (undefined) undefined
14+
Fail Explicit value true for type i32 assert_equals: value expected (number) 1 but got (undefined) undefined
15+
Fail Explicit value false for type i32 assert_equals: value expected (number) 0 but got (undefined) undefined
16+
Fail Explicit value 2 for type i32 assert_equals: value expected (number) 2 but got (undefined) undefined
17+
Fail Explicit value "3" for type i32 assert_equals: value expected (number) 3 but got (undefined) undefined
18+
Fail Explicit value object with toString for type i32 assert_equals: value expected (number) 5 but got (undefined) undefined
19+
Fail Explicit value object with valueOf for type i32 assert_equals: value expected (number) 8 but got (undefined) undefined
20+
Fail Default value for type f32 assert_equals: value expected (number) 0 but got (undefined) undefined
21+
Fail Explicit value undefined for type f32 assert_equals: value expected (number) 0 but got (undefined) undefined
22+
Fail Explicit value null for type f32 assert_equals: value expected (number) 0 but got (undefined) undefined
23+
Fail Explicit value true for type f32 assert_equals: value expected (number) 1 but got (undefined) undefined
24+
Fail Explicit value false for type f32 assert_equals: value expected (number) 0 but got (undefined) undefined
25+
Fail Explicit value 2 for type f32 assert_equals: value expected (number) 2 but got (undefined) undefined
26+
Fail Explicit value "3" for type f32 assert_equals: value expected (number) 3 but got (undefined) undefined
27+
Fail Explicit value object with toString for type f32 assert_equals: value expected (number) 5 but got (undefined) undefined
28+
Fail Explicit value object with valueOf for type f32 assert_equals: value expected (number) 8 but got (undefined) undefined
29+
Fail Default value for type f64 assert_equals: value expected (number) 0 but got (undefined) undefined
30+
Fail Explicit value undefined for type f64 assert_equals: value expected (number) 0 but got (undefined) undefined
31+
Fail Explicit value null for type f64 assert_equals: value expected (number) 0 but got (undefined) undefined
32+
Fail Explicit value true for type f64 assert_equals: value expected (number) 1 but got (undefined) undefined
33+
Fail Explicit value false for type f64 assert_equals: value expected (number) 0 but got (undefined) undefined
34+
Fail Explicit value 2 for type f64 assert_equals: value expected (number) 2 but got (undefined) undefined
35+
Fail Explicit value "3" for type f64 assert_equals: value expected (number) 3 but got (undefined) undefined
36+
Fail Explicit value object with toString for type f64 assert_equals: value expected (number) 5 but got (undefined) undefined
37+
Fail Explicit value object with valueOf for type f64 assert_equals: value expected (number) 8 but got (undefined) undefined
38+
Fail Stray argument assert_equals: value expected (number) 0 but got (undefined) undefined
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
Harness Status: OK
22
Found 1 tests: Fail = 1
3-
Fail Object.prototype.toString on an Global Object doesn't support this action
3+
Fail Object.prototype.toString on an Global assert_equals: expected "[object WebAssembly.Global]" but got "[object Object]"
Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
11
Harness Status: OK
22
Found 34 tests: Fail = 34
3-
Fail Branding Unable to get property 'prototype' of undefined or null reference
4-
Fail Immutable i32 (missing) Object doesn't support this action
5-
Fail Immutable i32 (undefined) Object doesn't support this action
6-
Fail Immutable i32 (null) Object doesn't support this action
7-
Fail Immutable i32 (false) Object doesn't support this action
8-
Fail Immutable i32 (empty string) Object doesn't support this action
9-
Fail Immutable i32 (zero) Object doesn't support this action
10-
Fail Mutable i32 (true) Object doesn't support this action
11-
Fail Mutable i32 (one) Object doesn't support this action
12-
Fail Mutable i32 (string) Object doesn't support this action
13-
Fail Mutable i32 (true on prototype) Object doesn't support this action
14-
Fail Immutable f32 (missing) Object doesn't support this action
15-
Fail Immutable f32 (undefined) Object doesn't support this action
16-
Fail Immutable f32 (null) Object doesn't support this action
17-
Fail Immutable f32 (false) Object doesn't support this action
18-
Fail Immutable f32 (empty string) Object doesn't support this action
19-
Fail Immutable f32 (zero) Object doesn't support this action
20-
Fail Mutable f32 (true) Object doesn't support this action
21-
Fail Mutable f32 (one) Object doesn't support this action
22-
Fail Mutable f32 (string) Object doesn't support this action
23-
Fail Mutable f32 (true on prototype) Object doesn't support this action
24-
Fail Immutable f64 (missing) Object doesn't support this action
25-
Fail Immutable f64 (undefined) Object doesn't support this action
26-
Fail Immutable f64 (null) Object doesn't support this action
27-
Fail Immutable f64 (false) Object doesn't support this action
28-
Fail Immutable f64 (empty string) Object doesn't support this action
29-
Fail Immutable f64 (zero) Object doesn't support this action
30-
Fail Mutable f64 (true) Object doesn't support this action
31-
Fail Mutable f64 (one) Object doesn't support this action
32-
Fail Mutable f64 (string) Object doesn't support this action
33-
Fail Mutable f64 (true on prototype) Object doesn't support this action
34-
Fail i64 with default Object doesn't support this action
35-
Fail Calling setter without argument Object doesn't support this action
36-
Fail Stray argument Object doesn't support this action
3+
Fail Branding assert_equals: expected "object" but got "undefined"
4+
Fail Immutable i32 (missing) assert_equals: initial value expected (number) 0 but got (undefined) undefined
5+
Fail Immutable i32 (undefined) assert_equals: initial value expected (number) 0 but got (undefined) undefined
6+
Fail Immutable i32 (null) assert_equals: initial value expected (number) 0 but got (undefined) undefined
7+
Fail Immutable i32 (false) assert_equals: initial value expected (number) 0 but got (undefined) undefined
8+
Fail Immutable i32 (empty string) assert_equals: initial value expected (number) 0 but got (undefined) undefined
9+
Fail Immutable i32 (zero) assert_equals: initial value expected (number) 0 but got (undefined) undefined
10+
Fail Mutable i32 (true) assert_equals: initial value expected (number) 0 but got (undefined) undefined
11+
Fail Mutable i32 (one) assert_equals: initial value expected (number) 0 but got (undefined) undefined
12+
Fail Mutable i32 (string) assert_equals: initial value expected (number) 0 but got (undefined) undefined
13+
Fail Mutable i32 (true on prototype) assert_equals: initial value expected (number) 0 but got (undefined) undefined
14+
Fail Immutable f32 (missing) assert_equals: initial value expected (number) 0 but got (undefined) undefined
15+
Fail Immutable f32 (undefined) assert_equals: initial value expected (number) 0 but got (undefined) undefined
16+
Fail Immutable f32 (null) assert_equals: initial value expected (number) 0 but got (undefined) undefined
17+
Fail Immutable f32 (false) assert_equals: initial value expected (number) 0 but got (undefined) undefined
18+
Fail Immutable f32 (empty string) assert_equals: initial value expected (number) 0 but got (undefined) undefined
19+
Fail Immutable f32 (zero) assert_equals: initial value expected (number) 0 but got (undefined) undefined
20+
Fail Mutable f32 (true) assert_equals: initial value expected (number) 0 but got (undefined) undefined
21+
Fail Mutable f32 (one) assert_equals: initial value expected (number) 0 but got (undefined) undefined
22+
Fail Mutable f32 (string) assert_equals: initial value expected (number) 0 but got (undefined) undefined
23+
Fail Mutable f32 (true on prototype) assert_equals: initial value expected (number) 0 but got (undefined) undefined
24+
Fail Immutable f64 (missing) assert_equals: initial value expected (number) 0 but got (undefined) undefined
25+
Fail Immutable f64 (undefined) assert_equals: initial value expected (number) 0 but got (undefined) undefined
26+
Fail Immutable f64 (null) assert_equals: initial value expected (number) 0 but got (undefined) undefined
27+
Fail Immutable f64 (false) assert_equals: initial value expected (number) 0 but got (undefined) undefined
28+
Fail Immutable f64 (empty string) assert_equals: initial value expected (number) 0 but got (undefined) undefined
29+
Fail Immutable f64 (zero) assert_equals: initial value expected (number) 0 but got (undefined) undefined
30+
Fail Mutable f64 (true) assert_equals: initial value expected (number) 0 but got (undefined) undefined
31+
Fail Mutable f64 (one) assert_equals: initial value expected (number) 0 but got (undefined) undefined
32+
Fail Mutable f64 (string) assert_equals: initial value expected (number) 0 but got (undefined) undefined
33+
Fail Mutable f64 (true on prototype) assert_equals: initial value expected (number) 0 but got (undefined) undefined
34+
Fail i64 with default assert_throws: function "() => global.value" did not throw
35+
Fail Calling setter without argument assert_equals: expected "object" but got "undefined"
36+
Fail Stray argument assert_equals: expected "object" but got "undefined"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Harness Status: OK
22
Found 2 tests: Fail = 2
3-
Fail Branding Unable to get property 'prototype' of undefined or null reference
4-
Fail Stray argument Object doesn't support this action
3+
Fail Branding assert_throws: this=true function "() => fn.call(thisValue)" did not throw
4+
Fail Stray argument assert_equals: expected (number) 0 but got (object) object "[object Object]"
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
Harness Status: OK
2+
Found 72 tests: Pass = 54 Fail = 18
3+
Pass WebAssembly: property descriptor
4+
Pass WebAssembly: calling
5+
Pass WebAssembly: constructing
6+
Pass WebAssembly.Module: property descriptor
7+
Pass WebAssembly.Module: prototype
8+
Pass WebAssembly.Module: prototype.constructor
9+
Pass WebAssembly.Instance: property descriptor
10+
Pass WebAssembly.Instance: prototype
11+
Pass WebAssembly.Instance: prototype.constructor
12+
Pass WebAssembly.Memory: property descriptor
13+
Pass WebAssembly.Memory: prototype
14+
Pass WebAssembly.Memory: prototype.constructor
15+
Pass WebAssembly.Table: property descriptor
16+
Pass WebAssembly.Table: prototype
17+
Pass WebAssembly.Table: prototype.constructor
18+
Fail WebAssembly.Global: property descriptor assert_false: enumerable expected false got true
19+
Pass WebAssembly.Global: prototype
20+
Pass WebAssembly.Global: prototype.constructor
21+
Pass WebAssembly.CompileError: property descriptor
22+
Pass WebAssembly.CompileError: prototype
23+
Pass WebAssembly.CompileError: prototype.constructor
24+
Pass WebAssembly.LinkError: property descriptor
25+
Pass WebAssembly.LinkError: prototype
26+
Pass WebAssembly.LinkError: prototype.constructor
27+
Pass WebAssembly.RuntimeError: property descriptor
28+
Pass WebAssembly.RuntimeError: prototype
29+
Pass WebAssembly.RuntimeError: prototype.constructor
30+
Fail WebAssembly.validate assert_true: enumerable expected true got false
31+
Pass WebAssembly.validate: name
32+
Pass WebAssembly.validate: length
33+
Fail WebAssembly.compile assert_true: enumerable expected true got false
34+
Pass WebAssembly.compile: name
35+
Pass WebAssembly.compile: length
36+
Fail WebAssembly.instantiate assert_true: enumerable expected true got false
37+
Pass WebAssembly.instantiate: name
38+
Pass WebAssembly.instantiate: length
39+
Fail WebAssembly.Module.exports assert_true: enumerable expected true got false
40+
Pass WebAssembly.Module.exports: name
41+
Pass WebAssembly.Module.exports: length
42+
Fail WebAssembly.Module.imports assert_true: enumerable expected true got false
43+
Pass WebAssembly.Module.imports: name
44+
Pass WebAssembly.Module.imports: length
45+
Fail WebAssembly.Module.customSections assert_true: enumerable expected true got false
46+
Pass WebAssembly.Module.customSections: name
47+
Pass WebAssembly.Module.customSections: length
48+
Fail WebAssembly.Instance.exports assert_true: enumerable expected true got false
49+
Pass WebAssembly.Instance.exports: getter
50+
Pass WebAssembly.Instance.exports: setter
51+
Fail WebAssembly.Memory.grow assert_true: enumerable expected true got false
52+
Pass WebAssembly.Memory.grow: name
53+
Pass WebAssembly.Memory.grow: length
54+
Fail WebAssembly.Memory.buffer assert_true: enumerable expected true got false
55+
Pass WebAssembly.Memory.buffer: getter
56+
Pass WebAssembly.Memory.buffer: setter
57+
Fail WebAssembly.Table.grow assert_true: enumerable expected true got false
58+
Pass WebAssembly.Table.grow: name
59+
Pass WebAssembly.Table.grow: length
60+
Fail WebAssembly.Table.get assert_true: enumerable expected true got false
61+
Pass WebAssembly.Table.get: name
62+
Pass WebAssembly.Table.get: length
63+
Fail WebAssembly.Table.set assert_true: enumerable expected true got false
64+
Pass WebAssembly.Table.set: name
65+
Pass WebAssembly.Table.set: length
66+
Fail WebAssembly.Table.length assert_true: enumerable expected true got false
67+
Pass WebAssembly.Table.length: getter
68+
Pass WebAssembly.Table.length: setter
69+
Fail WebAssembly.Global.valueOf assert_equals: expected "object" but got "undefined"
70+
Pass WebAssembly.Global.valueOf: name
71+
Pass WebAssembly.Global.valueOf: length
72+
Fail WebAssembly.Global.value assert_equals: expected "object" but got "undefined"
73+
Fail WebAssembly.Global.value: getter assert_equals: expected "object" but got "undefined"
74+
Fail WebAssembly.Global.value: setter assert_equals: expected "object" but got "undefined"

test/WasmSpec/baselines/testsuite/js-api/table/assertions.baseline

Whitespace-only changes.

test/WasmSpec/convert-test-suite/config.json renamed to test/WasmSpec/convert-test-suite/config.json5

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,8 @@
33
"chakra",
44
"chakra_generated",
55
"testsuite/core",
6-
"testsuite/js-api/constructor",
7-
"testsuite/js-api/global",
8-
"testsuite/js-api/instance",
9-
"testsuite/js-api/memory",
10-
"testsuite/js-api/module",
11-
"testsuite/js-api/table",
12-
13-
"features/extends",
14-
"features/nontrapping",
15-
"features/threads"
6+
"testsuite/js-api",
7+
"features",
168
],
179
"features": [{
1810
"flags": ["-wasmfastarray-"],
@@ -23,7 +15,7 @@
2315
"testsuite/core/memory.wast",
2416
"testsuite/core/memory_trap.wast",
2517
"testsuite/core/resizing.wast",
26-
"testsuite/core/traps.wast"
18+
"testsuite/core/traps.wast",
2719
]
2820
}, {
2921
"flags": ["-wasmMathExFilter"],
@@ -33,7 +25,7 @@
3325
"testsuite/core/i64.wast",
3426
"chakra_generated/chakra_i32.wast",
3527
"chakra_generated/chakra_i64.wast",
36-
"testsuite/core/traps.wast"
28+
"testsuite/core/traps.wast",
3729
]
3830
}, {
3931
"required": true,
@@ -43,7 +35,7 @@
4335
],
4436
"files": [
4537
"chakra_generated/chakra_extends_i32.wast",
46-
"chakra_generated/chakra_extends_i64.wast"
38+
"chakra_generated/chakra_extends_i64.wast",
4739
]
4840
}, {
4941
"required": true,
@@ -59,7 +51,7 @@
5951
],
6052
"files": [
6153
"chakra/chakra_atomic_load.wast",
62-
"chakra/chakra_atomic_store.wast"
54+
"chakra/chakra_atomic_store.wast",
6355
]
6456
}, {
6557
"flags": ["-WasmThreads", "-ESSharedArrayBuffer", "-WasmSharedArrayVirtualBuffer-", "-WasmFastArray-"],
@@ -68,11 +60,22 @@
6860
],
6961
"files": [
7062
"chakra/chakra_atomic_load.wast",
71-
"chakra/chakra_atomic_store.wast"
63+
"chakra/chakra_atomic_store.wast",
7264
]
7365
}],
7466
"excludes": [
75-
"testsuite/core/names.wast"
67+
// Names not supported yet
68+
"testsuite/core/names.wast",
69+
// Limits testing is too slow and is mostly a duplicate of tests/wasm/limts.js
70+
"testsuite/js-api/limits.js",
71+
72+
// Harness files, no tests in there
73+
"testsuite/js-api/assertions.js",
74+
"testsuite/js-api/bad-imports.js",
75+
"testsuite/js-api/instanceTestFactory.js",
76+
"testsuite/js-api/wasm-constants.js",
77+
"testsuite/js-api/wasm-module-builder.js",
78+
"testsuite/js-api/table/assertions.js",
7679
],
7780
"xplat-excludes": [
7881
]

test/WasmSpec/convert-test-suite/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@ const fs = require("fs-extra");
88
const Bluebird = require("bluebird");
99
const {spawn} = require("child_process");
1010
const slash = require("slash");
11+
const json5 = require("json5");
1112

1213
Bluebird.promisifyAll(fs);
13-
const config = require("./config.json");
14+
const config = json5.parse(fs.readFileSync(path.join(__dirname, "config.json5")));
1415
const rlRoot = path.resolve(__dirname, "..");
1516
const folders = config.folders.map(folder => path.resolve(rlRoot, folder));
1617
const baselineDir = path.join(rlRoot, "baselines");

0 commit comments

Comments
 (0)