Upload Kmake

This commit is contained in:
Gorochu
2026-05-26 23:36:42 -07:00
parent ba051b2f74
commit 555ec72358
41615 changed files with 13344630 additions and 1 deletions

17
deps/v8/test/wasm-js/BUILD.gn vendored Normal file
View File

@ -0,0 +1,17 @@
# Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
group("v8_wasm_js") {
testonly = true
data_deps = [
"../..:d8",
"../../tools:v8_testrunner",
]
data = [
"./",
"../mjsunit/mjsunit.js",
]
}

1
deps/v8/test/wasm-js/OWNERS vendored Normal file
View File

@ -0,0 +1 @@
file:../../src/wasm/OWNERS

6
deps/v8/test/wasm-js/after.js vendored Normal file
View File

@ -0,0 +1,6 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Tell the test harness that we are done with all tests.
done();

39
deps/v8/test/wasm-js/report.js vendored Normal file
View File

@ -0,0 +1,39 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function check_test_results(tests, status) {
let failed_counter = 0;
for (let test of tests) {
const PASS = 0;
const FAIL = 1;
const TIMEOUT = 2;
const NOTRUN = 3;
const PRECONDITION_FAILED = 4;
if (test.status !== PASS) {
console.log();
if (test.status === FAIL) {
console.log("Test failed");
} else if(test.status === TIMEOUT) {
console.log("Timeout");
} else if(test.status === NOTRUN) {
console.log("Test did not run");
} else if (test.status === PRECONDITION_FAILED) {
console.log("Test precondition failed");
} else {
console.log("Unknown error code:", test.status);
}
console.log("Message:");
console.log(test.message);
console.log("Stack trace:");
console.log(test.stack);
failed_counter++;
}
}
setTimeout(() => assertEquals(0, failed_counter));
}
add_completion_callback(check_test_results);
setup(() => {}, {'explicit_done': true});

145
deps/v8/test/wasm-js/testcfg.py vendored Normal file
View File

@ -0,0 +1,145 @@
# Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import re
from pathlib import Path
from testrunner.local import testsuite
from testrunner.objects import testcase
ANY_JS = ".any.js"
WPT_ROOT = "/wasm/jsapi/"
META_SCRIPT_REGEXP = re.compile(r"META:\s*script=(.*)")
META_TIMEOUT_REGEXP = re.compile(r"META:\s*timeout=(.*)")
proposal_flags = [
{
'name': 'js-types',
'flags': ['--experimental-wasm-type-reflection']
},
{
'name': 'tail-call',
'flags': []
},
{
'name': 'memory64',
# The memory64 repository is rebased on exnref, so also enable that.
'flags': ['--experimental-wasm-exnref']
},
{
'name': 'extended-const',
'flags': []
},
{
'name': 'function-references',
'flags': []
},
{
'name': 'gc',
'flags': []
},
{
'name': 'jspi',
'flags': ['--experimental-wasm-jspi']
},
{
'name': 'exception-handling',
'flags': ['--experimental-wasm-exnref']
},
]
wpt_flags = [
{
'name': 'memory',
'flags': ['--experimental-wasm-rab-integration', '--wasm-staging']
},
]
class TestLoader(testsuite.JSTestLoader):
@property
def extensions(self):
return [ANY_JS]
class TestSuite(testsuite.TestSuite):
def __init__(self, ctx, *args, **kwargs):
super(TestSuite, self).__init__(ctx, *args, **kwargs)
self.mjsunit_js = self.root.parent / "mjsunit" /"mjsunit.js"
self.test_root = self.root / "tests"
self._test_loader.test_root = self.test_root
def _test_loader_class(self):
return TestLoader
def _test_class(self):
return TestCase
def get_proposal_identifier(proposal):
return f"proposals/{proposal['name']}"
class TestCase(testcase.D8TestCase):
def _get_timeout_param(self):
source = self.get_source()
timeout_params = META_TIMEOUT_REGEXP.findall(source)
if not timeout_params:
return None
if timeout_params[0] in ["long"]:
return timeout_params[0]
else:
print("unknown timeout param %s in %s%s"
% (timeout_params[0], self.path, ANY_JS))
return None
def _get_files_params(self):
files = [self.suite.mjsunit_js,
self.suite.root / "third_party" / "testharness.js",
self.suite.root / "testharness-additions.js",
self.suite.root / "report.js"]
source = self.get_source()
current_dir = self._get_source_path().parent
for script in META_SCRIPT_REGEXP.findall(source):
if script.startswith(WPT_ROOT):
# Matched an absolute path, strip the root and replace it with our
# local root.
found = False
for proposal in proposal_flags:
prop_path = get_proposal_identifier(proposal)
if prop_path in current_dir.as_posix():
found = True
script = self.suite.test_root / prop_path / script[len(WPT_ROOT):]
if 'wpt' in current_dir.as_posix():
found = True
script = self.suite.test_root / 'wpt' / script[len(WPT_ROOT):]
if not found:
script = self.suite.test_root / script[len(WPT_ROOT):]
elif not Path(script).is_absolute():
# Matched a relative path, prepend this test's directory.
script = current_dir / script
else:
raise Exception(f"Unexpected absolute path for script: \"{script}\"");
files.append(script)
files.extend([self._get_source_path(), self.suite.root / "after.js"])
return files
def _get_source_flags(self):
for proposal in proposal_flags:
if get_proposal_identifier(proposal) in self.name:
return proposal['flags']
for wpt_entry in wpt_flags:
if f"wpt/{wpt_entry['name']}" in self.name:
return wpt_entry['flags']
return ['--wasm-staging']
def _get_source_path(self):
# All tests are named `path/name.any.js`
return self.suite.test_root / self.path_and_suffix(ANY_JS)

View File

@ -0,0 +1,26 @@
// Copyright 2020 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
function assert_throws(code, func, description) {
try {
func();
} catch (e) {
assert_true(
e.name === code.name,
'expected exception ' + code.name + ', got ' + e.name);
return;
}
assert_true(
false, 'expected exception ' + code.name + ', no exception thrown');
}
function promise_rejects(test, expected, promise, description) {
return promise
.then(() => assert_unreached('Should have rejected: ' + description))
.catch(function(e) {
assert_throws(expected, function() {
throw e;
}, description);
});
}

View File

@ -0,0 +1 @@
8a69e14a26326662093099426eff78db6d409761

View File

@ -0,0 +1,11 @@
# The 3-Clause BSD License
Copyright 2019 web-platform-tests contributors
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File diff suppressed because it is too large Load Diff

96
deps/v8/test/wasm-js/wasm-js.status vendored Normal file
View File

@ -0,0 +1,96 @@
# Copyright 2018 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
[
[ALWAYS, {
# This test can only be executed in the browser
'wpt/idlharness': [SKIP],
# Failing WPT tests
'wpt/function/constructor.tentative': [FAIL],
# TODO(v8): Should work after
# https://github.com/WebAssembly/exception-handling/pull/257 landed and the
# tests have been updated.
'wpt/exception/getArg.tentative': [FAIL],
# This is a spec test of the https://github.com/WebAssembly/esm-integration
# proposal which V8 does not implement yet.
'wpt/module/moduleSource.tentative': [FAIL],
# Tests that need to run sequentially (e.g. due to memory consumption).
# TODO(14258): Switch back to [PASS, HEAVY] once wasm-js tests allow more
# than one memory. Github issue:
# https://github.com/WebAssembly/multi-memory/issues/49
'limits': [FAIL, HEAVY],
# TODO(thibaudm): Test failing after the type-reflection change around
# WebAssembly.Function.type. The tests should be updated anyway since they
# still use the old API (which works but is deprecated).
'proposals/js-promise-integration/js-promise-integration/js-promise-integration': [FAIL],
# TODO(https://crbug.com/42202693): RAB / GSAB integration.
'wpt/memory/to-fixed-length-buffer': [FAIL],
'wpt/memory/to-resizable-buffer': [FAIL],
# TODO(402340845): This requires the type reflection proposal to be staged or enabled by default.
'wpt/function/call.tentative': [FAIL],
'wpt/function/table.tentative': [FAIL],
'wpt/function/type.tentative': [FAIL],
'wpt/global/type.tentative': [FAIL],
'wpt/memory/constructor-types.tentative': [FAIL],
'wpt/memory/type.tentative': [FAIL],
'wpt/table/constructor-types.tentative': [FAIL],
'wpt/table/type.tentative': [FAIL],
'wpt/tag/type.tentative': [FAIL],
}], # ALWAYS
['system == android', {
# Slow, and we always have the same limits anyway.
# Android bots don't have enough memory to run the test.
'limits': [SKIP],
}], # 'system == android'
['arch == s390x or system == aix', {
# https://bugs.chromium.org/p/v8/issues/detail?id=8402
'instance/constructor': [SKIP],
'constructor/instantiate': [SKIP],
}], # 'arch == s390x or system == aix'
['arch == ppc64', {
# Test needs larger than supported single code space.
'limits': [SKIP],
}], # 'arch == ppc64'
['mode == debug or simulator_run or variant != default or arch == arm or tsan or msan or asan', {
# Slow, and we always have the same limits anyway.
# ODroid bots don't have enough memory to run the test.
'limits': [SKIP],
}], # mode == debug or simulator_run or variant != default or arch == arm or tsan or msan or asan
##############################################################################
# TODO(v8:7777): Change this once wasm is supported in jitless mode.
['not has_webassembly or variant == jitless', {
'*': [SKIP],
}], # not has_webassembly or variant == jitless
##############################################################################
['variant == stress_snapshot', {
'*': [SKIP], # only relevant for mjsunit tests.
}],
##############################################################################
['arch != x64 and arch != arm64 and arch != ia32 and arch != arm and arch != riscv64 and arch != loong64 and arch != ppc64 and arch != s390x', {
# Stack switching is not supported on all platforms.
'proposals/js-promise-integration/js-promise-integration/js-promise-integration': [SKIP],
'wpt/jspi/*': [SKIP]
}], # (arch != x64 and arch != arm64 and arch != ia32 and arch != arm and arch != riscv64 and arch != loong64 and arch != ppc64 and arch != s390x)
##############################################################################
['cet_shadow_stack', {
# It does not support multiple stacks yet.
'proposals/js-promise-integration/js-promise-integration/js-promise-integration': [SKIP],
'wpt/jspi/*': [SKIP]
}] # cet_shadow_stack
]