2017-04-27 12:28:05 +00: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.
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
from testrunner.local import testsuite
|
2017-12-13 12:47:24 +00:00
|
|
|
from testrunner.objects import testcase
|
2017-04-27 12:28:05 +00:00
|
|
|
|
2019-07-17 14:49:47 +00:00
|
|
|
proposal_flags = [{
|
|
|
|
'name': 'reference-types',
|
|
|
|
'flags': ['--experimental-wasm-anyref',
|
2019-08-28 11:26:02 +00:00
|
|
|
'--no-experimental-wasm-bulk-memory']
|
2019-07-17 14:49:47 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'bulk-memory-operations',
|
|
|
|
'flags': ['--experimental-wasm-bulk-memory']
|
2019-08-28 11:26:02 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'js-types',
|
|
|
|
'flags': ['--experimental-wasm-type-reflection',
|
|
|
|
'--no-experimental-wasm-bulk-memory']
|
2019-09-05 10:44:10 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
'name': 'JS-BigInt-integration',
|
|
|
|
'flags': ['--experimental-wasm-bigint']
|
|
|
|
},
|
|
|
|
]
|
2019-02-05 14:00:49 +00:00
|
|
|
|
|
|
|
class TestLoader(testsuite.JSTestLoader):
|
|
|
|
pass
|
|
|
|
|
2017-12-13 12:47:24 +00:00
|
|
|
class TestSuite(testsuite.TestSuite):
|
2019-08-27 14:14:34 +00:00
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super(TestSuite, self).__init__(*args, **kwargs)
|
|
|
|
self.test_root = os.path.join(self.root, "tests")
|
|
|
|
self._test_loader.test_root = self.test_root
|
|
|
|
|
2019-02-05 14:00:49 +00:00
|
|
|
def _test_loader_class(self):
|
|
|
|
return TestLoader
|
2017-04-27 12:28:05 +00:00
|
|
|
|
2017-12-12 21:33:16 +00:00
|
|
|
def _test_class(self):
|
2017-12-13 12:47:24 +00:00
|
|
|
return TestCase
|
2017-12-12 21:33:16 +00:00
|
|
|
|
2018-08-29 13:52:04 +00:00
|
|
|
class TestCase(testcase.D8TestCase):
|
2018-01-31 12:01:49 +00:00
|
|
|
def _get_files_params(self):
|
2019-08-27 14:14:34 +00:00
|
|
|
return [os.path.join(self.suite.test_root, self.path + self._get_suffix())]
|
2017-04-27 12:28:05 +00:00
|
|
|
|
2019-07-17 14:49:47 +00:00
|
|
|
def _get_source_flags(self):
|
|
|
|
for proposal in proposal_flags:
|
|
|
|
if os.sep.join(['proposals', proposal['name']]) in self.path:
|
|
|
|
return proposal['flags']
|
|
|
|
return []
|
|
|
|
|
2017-04-27 12:28:05 +00:00
|
|
|
|
2018-01-31 09:18:13 +00:00
|
|
|
def GetSuite(*args, **kwargs):
|
|
|
|
return TestSuite(*args, **kwargs)
|