Commit f348e573 authored by Eric Holk's avatar Eric Holk Committed by Commit Bot

[wasm] Update JS API tests to version 1

BUG= https://bugs.chromium.org/p/chromium/issues/detail?id=694954

Change-Id: I07d7eeccca716028e1151db3df7ebee81d4a9ef2
Reviewed-on: https://chromium-review.googlesource.com/446707
Commit-Queue: Eric Holk <eholk@chromium.org>
Reviewed-by: 's avatarMircea Trofin <mtrofin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#43460}
parent bbeb6dc1
...@@ -40,7 +40,7 @@ deps = { ...@@ -40,7 +40,7 @@ deps = {
"v8/tools/clang": "v8/tools/clang":
Var("chromium_url") + "/chromium/src/tools/clang.git" + "@" + "9913fb19b687b0c858f697efd7bd2468d789a3d5", Var("chromium_url") + "/chromium/src/tools/clang.git" + "@" + "9913fb19b687b0c858f697efd7bd2468d789a3d5",
"v8/test/wasm-js": "v8/test/wasm-js":
Var("chromium_url") + "/external/github.com/WebAssembly/spec.git" + "@" + "b8b919e4a0d52db4d3d762e731e615bc3a38b3b2", Var("chromium_url") + "/external/github.com/WebAssembly/spec.git" + "@" + "002e57c86ccf5c80db0de6e40246665340350c43",
} }
deps_os = { deps_os = {
......
...@@ -2,9 +2,6 @@ ...@@ -2,9 +2,6 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// TODO(titzer): update spec test suite to version 0x1
if (false) {
// TODO(eholk): Once we have stable test IDs, use those as the key instead. // TODO(eholk): Once we have stable test IDs, use those as the key instead.
// See https://github.com/WebAssembly/spec/issues/415 // See https://github.com/WebAssembly/spec/issues/415
const known_failures = { const known_failures = {
...@@ -14,9 +11,12 @@ const known_failures = { ...@@ -14,9 +11,12 @@ const known_failures = {
'https://bugs.chromium.org/p/v8/issues/detail?id=5507', 'https://bugs.chromium.org/p/v8/issues/detail?id=5507',
"'WebAssembly.Table.prototype.set' method": "'WebAssembly.Table.prototype.set' method":
'https://bugs.chromium.org/p/v8/issues/detail?id=5507', 'https://bugs.chromium.org/p/v8/issues/detail?id=5507',
"'WebAssembly.Instance' constructor function":
'https://bugs.chromium.org/p/v8/issues/detail?id=6017',
}; };
let failures = []; let failures = [];
let unexpected_successes = [];
let last_promise = new Promise((resolve, reject) => { resolve(); }); let last_promise = new Promise((resolve, reject) => { resolve(); });
...@@ -25,18 +25,34 @@ function test(func, description) { ...@@ -25,18 +25,34 @@ function test(func, description) {
try { func(); } try { func(); }
catch(e) { maybeErr = e; } catch(e) { maybeErr = e; }
if (typeof maybeErr !== 'undefined') { if (typeof maybeErr !== 'undefined') {
print(`${description}: FAIL. ${maybeErr}`); var known = "";
if (known_failures[description]) {
known = " (known)";
}
print(`${description}: FAIL${known}. ${maybeErr}`);
failures.push(description); failures.push(description);
} else { } else {
if (known_failures[description]) {
unexpected_successes.push(description);
}
print(`${description}: PASS.`); print(`${description}: PASS.`);
} }
} }
function promise_test(func, description) { function promise_test(func, description) {
last_promise = last_promise.then(func) last_promise = last_promise.then(func)
.then(_ => { print(`${description}: PASS.`); }) .then(_ => {
if (known_failures[description]) {
unexpected_successes.push(description);
}
print(`${description}: PASS.`);
})
.catch(err => { .catch(err => {
print(`${description}: FAIL. ${err}`); var known = "";
if (known_failures[description]) {
known = " (known)";
}
print(`${description}: FAIL${known}. ${err}`);
failures.push(description); failures.push(description);
}); });
} }
...@@ -74,10 +90,18 @@ last_promise.then(_ => { ...@@ -74,10 +90,18 @@ last_promise.then(_ => {
unexpected = true; unexpected = true;
} }
} }
if (unexpected_successes.length > 0) {
unexpected = true;
print("");
print("Unexpected successes:");
for(let i in unexpected_successes) {
print(` ${unexpected_successes[i]}`);
}
print("Some tests SUCCEEDED but were known failures. If you've fixed " +
"the bug, please remove the test from the known failures list.")
}
if (unexpected) { if (unexpected) {
quit(1); quit(1);
} }
} }
}); });
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment