2017-08-01 11:36:44 -05:00
|
|
|
# Copyright 2017 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.
|
|
|
|
|
|
|
|
from testrunner.local import testsuite
|
|
|
|
from testrunner.objects import testcase
|
|
|
|
|
2025-04-29 08:03:15 +02:00
|
|
|
# We use the 'wasm-3.0' branch on the main spec repo, so enable all proposals
|
|
|
|
# that were merged into that branch.
|
|
|
|
default_flags = ['--experimental-wasm-exnref']
|
|
|
|
|
2023-03-30 12:11:08 +02:00
|
|
|
proposal_flags = [
|
|
|
|
{
|
|
|
|
'name': 'js-types',
|
2023-10-05 08:46:07 +02:00
|
|
|
'flags': ['--experimental-wasm-type-reflection']
|
2023-03-30 12:11:08 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'tail-call',
|
2024-03-30 09:54:35 +01:00
|
|
|
'flags': []
|
2023-03-30 12:11:08 +02:00
|
|
|
},
|
|
|
|
{
|
2025-04-29 08:03:15 +02:00
|
|
|
'name':
|
|
|
|
'memory64',
|
|
|
|
'flags': [
|
|
|
|
# The memory64 repository is rebased on the upstream 'wasm-3.0'
|
|
|
|
# branch, which contains exnref.
|
|
|
|
'--experimental-wasm-exnref'
|
|
|
|
]
|
2023-03-30 12:11:08 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'extended-const',
|
2024-03-30 09:54:35 +01:00
|
|
|
'flags': []
|
2023-10-05 08:46:07 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'function-references',
|
2024-03-30 09:54:35 +01:00
|
|
|
'flags': []
|
2023-10-05 08:46:07 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'gc',
|
2024-03-30 09:54:35 +01:00
|
|
|
'flags': []
|
2023-10-05 08:46:07 +02:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'multi-memory',
|
|
|
|
'flags': ['--experimental-wasm-multi-memory']
|
2023-03-30 12:11:08 +02:00
|
|
|
},
|
2024-03-30 09:54:35 +01:00
|
|
|
{
|
|
|
|
'name': 'exception-handling',
|
|
|
|
# This flag enables the *new* exception handling proposal. The legacy
|
|
|
|
# proposal is enabled by default.
|
2025-04-29 08:03:15 +02:00
|
|
|
'flags': ['--experimental-wasm-exnref']
|
2024-08-14 20:41:00 +02:00
|
|
|
},
|
|
|
|
{
|
2025-04-29 08:03:15 +02:00
|
|
|
'name':
|
|
|
|
'js-promise-integration',
|
|
|
|
'flags': [
|
|
|
|
'--experimental-wasm-jspi',
|
|
|
|
# The jspi repository is rebased on the upstream 'wasm-3.0'
|
|
|
|
# branch, which contains exnref.
|
|
|
|
'--experimental-wasm-exnref'
|
|
|
|
]
|
2024-03-30 09:54:35 +01:00
|
|
|
}
|
2023-03-30 12:11:08 +02:00
|
|
|
]
|
|
|
|
|
2019-03-15 18:35:06 +05:30
|
|
|
|
|
|
|
class TestLoader(testsuite.JSTestLoader):
|
|
|
|
pass
|
|
|
|
|
2018-03-07 08:54:53 +01:00
|
|
|
class TestSuite(testsuite.TestSuite):
|
2022-09-21 13:28:42 +02:00
|
|
|
|
|
|
|
def __init__(self, ctx, *args, **kwargs):
|
|
|
|
super(TestSuite, self).__init__(ctx, *args, **kwargs)
|
2023-10-05 08:46:07 +02:00
|
|
|
self.test_root = self.root / "tests"
|
2019-09-24 11:56:38 -04:00
|
|
|
self._test_loader.test_root = self.test_root
|
|
|
|
|
2019-03-15 18:35:06 +05:30
|
|
|
def _test_loader_class(self):
|
|
|
|
return TestLoader
|
2017-08-01 11:36:44 -05:00
|
|
|
|
2018-03-07 08:54:53 +01:00
|
|
|
def _test_class(self):
|
|
|
|
return TestCase
|
|
|
|
|
2018-12-04 08:20:37 +01:00
|
|
|
class TestCase(testcase.D8TestCase):
|
2018-04-10 21:39:51 -04:00
|
|
|
def _get_files_params(self):
|
2023-10-05 08:46:07 +02:00
|
|
|
return [self.suite.test_root / self.path_js]
|
2017-08-01 11:36:44 -05:00
|
|
|
|
2019-08-16 11:32:46 +02:00
|
|
|
def _get_source_flags(self):
|
|
|
|
for proposal in proposal_flags:
|
2023-10-05 08:46:07 +02:00
|
|
|
if f"proposals/{proposal['name']}" in self.name:
|
2019-08-16 11:32:46 +02:00
|
|
|
return proposal['flags']
|
2025-04-29 08:03:15 +02:00
|
|
|
return default_flags
|