Commit 3fb2ec7b authored by Andreas Haas's avatar Andreas Haas Committed by V8 LUCI CQ

[wasm] Add wasm wpt tests to the V8 tests

WPT and WebAssembly spec tests are not 100% in sync, which means that
there are aspects of the WebAssembly spec that get only tested by WPT.
Up until now WPT was only executed on the blink side, and failing tests
were just ignored. With this CL we add WPT to the existing wasm spec
test setup, so that we run both the spec tests, and WPT.

Bug: v8:12227
Change-Id: Iccbe696a6d9dd01f8bab1990736f1ed16e0cdf7b
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3160347Reviewed-by: 's avatarLiviu Rau <liviurau@chromium.org>
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Cr-Commit-Position: refs/heads/main@{#76823}
parent dc07ae76
......@@ -92,6 +92,10 @@ class TestCase(testcase.D8TestCase):
script = os.path.join(self.suite.test_root,
os.sep.join(['proposals', proposal['name']]),
script[len(WPT_ROOT):])
if 'wpt' in current_dir:
found = True
script = os.path.join(self.suite.test_root, 'wpt',
script[len(WPT_ROOT):])
if not found:
script = os.path.join(self.suite.test_root, script[len(WPT_ROOT):])
elif not script.startswith("/"):
......
47fd6174b31ba072c87780a01537140f817989dc
\ No newline at end of file
84eafbc6065be47130c0a43440a8b7c12db56062
\ No newline at end of file
......@@ -5,6 +5,24 @@
[
[ALWAYS, {
# This test can only be executed in the browser
'wpt/idlharness': [SKIP],
# Failing WPT tests
'wpt/table/type.tentative': [FAIL],
'wpt/table/set-reftypes.tentative': [FAIL],
'wpt/memory/constructor-types.tentative': [FAIL],
'wpt/prototypes': [FAIL],
'wpt/table/constructor-types.tentative': [FAIL],
'wpt/memory/types.tentative': [FAIL],
'wpt/function/constructor.tentative': [FAIL],
'wpt/exception/type.tentative': [FAIL],
'wpt/global/type.tentative': [FAIL],
'wpt/exception/toString.tentative': [FAIL],
'wpt/function/table.tentative': [FAIL],
'wpt/memory/type.tentative': [FAIL],
'wpt/function/type.tentative': [FAIL],
'wpt/table/grow-reftypes.tentative': [FAIL],
# TODO(v8:10556): Remove sub-typing in the reference-types implementation
'constructor/instantiate': [FAIL],
'instance/constructor': [FAIL],
......
51142d7857b770528a57965d94c7b5365bf9c1a7
\ No newline at end of file
c1aa4631a6449308da83b881b114b741b4a6732f
\ No newline at end of file
......@@ -25,7 +25,6 @@
'proposals/tail-call/func': [FAIL],
'proposals/tail-call/globals': [FAIL],
'proposals/tail-call/linking': [FAIL],
'proposals/tail-call/type': [FAIL],
# TODO(v8:11401): Fix memory64 spec tests / the v8 implementation (whatever
# is broken).
......
......@@ -44,6 +44,7 @@ log_and_run mkdir ${TMP_DIR}
log_and_run rm -rf ${JS_API_TEST_DIR}/tests
log_and_run mkdir ${JS_API_TEST_DIR}/tests
log_and_run mkdir ${JS_API_TEST_DIR}/tests/wpt
log_and_run mkdir ${JS_API_TEST_DIR}/tests/proposals
###############################################################################
......@@ -67,6 +68,25 @@ log_and_run cp ${TMP_DIR}/*.js ${SPEC_TEST_DIR}/tests/
log_and_run cp -r ${TMP_DIR}/spec/test/js-api/* ${JS_API_TEST_DIR}/tests
###############################################################################
# Generate the wpt tests.
###############################################################################
echo Process wpt
log_and_run cd ${TMP_DIR}
log_and_run git clone https://github.com/web-platform-tests/wpt
log_and_run cp -r wpt/wasm/jsapi/* ${JS_API_TEST_DIR}/tests/wpt
log_and_run cd ${JS_API_TEST_DIR}/tests
for spec_test_name in $(find ./ -name '*.any.js' -not -wholename '*/wpt/*'); do
wpt_test_name="wpt/${spec_test_name}"
if [ -f "$wpt_test_name" ] && cmp -s $spec_test_name $wpt_test_name ; then
log_and_run rm $wpt_test_name
elif [ -f "$wpt_test_name" ]; then
echo "keep" $wpt_test_name
fi
done
###############################################################################
# Generate the proposal tests.
###############################################################################
......
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