2016-01-26 10:38:37 +00:00
|
|
|
# Copyright 2016 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
|
2016-01-26 10:38:37 +00:00
|
|
|
|
2019-02-05 14:00:49 +00:00
|
|
|
SUB_TESTS = [
|
|
|
|
'json',
|
|
|
|
'parser',
|
|
|
|
'regexp_builtins',
|
|
|
|
'regexp',
|
|
|
|
'multi_return',
|
|
|
|
'wasm',
|
|
|
|
'wasm_async',
|
|
|
|
'wasm_code',
|
|
|
|
'wasm_compile',
|
|
|
|
]
|
2016-01-26 10:38:37 +00:00
|
|
|
|
2018-01-12 10:07:56 +00:00
|
|
|
class VariantsGenerator(testsuite.VariantsGenerator):
|
|
|
|
def _get_variants(self, test):
|
|
|
|
return self._standard_variant
|
|
|
|
|
|
|
|
|
2019-02-05 14:00:49 +00:00
|
|
|
class TestLoader(testsuite.GenericTestLoader):
|
|
|
|
@property
|
|
|
|
def test_dirs(self):
|
|
|
|
return SUB_TESTS
|
|
|
|
|
|
|
|
def _to_relpath(self, abspath, _):
|
|
|
|
return os.path.relpath(abspath, self.suite.root)
|
|
|
|
|
2020-08-04 15:47:01 +00:00
|
|
|
def _should_filter_by_name(self, _):
|
|
|
|
return False
|
2019-02-05 14:00:49 +00:00
|
|
|
|
2017-12-13 12:47:24 +00:00
|
|
|
class TestSuite(testsuite.TestSuite):
|
2019-02-05 14:00:49 +00:00
|
|
|
def _test_loader_class(self):
|
|
|
|
return TestLoader
|
2016-01-26 10:38:37 +00:00
|
|
|
|
2017-12-12 21:33:16 +00:00
|
|
|
def _test_class(self):
|
2017-12-13 12:47:24 +00:00
|
|
|
return TestCase
|
2016-01-26 10:38:37 +00:00
|
|
|
|
2018-01-12 10:07:56 +00:00
|
|
|
def _variants_gen_class(self):
|
|
|
|
return VariantsGenerator
|
|
|
|
|
2016-01-26 10:38:37 +00:00
|
|
|
|
2017-12-13 12:47:24 +00:00
|
|
|
class TestCase(testcase.TestCase):
|
2018-01-31 12:01:49 +00:00
|
|
|
def _get_files_params(self):
|
2019-02-05 14:00:49 +00:00
|
|
|
suite, name = self.path.split(os.path.sep)
|
2017-12-12 21:33:16 +00:00
|
|
|
return [os.path.join(self.suite.root, suite, name)]
|
|
|
|
|
|
|
|
def _get_variant_flags(self):
|
|
|
|
return []
|
|
|
|
|
|
|
|
def _get_statusfile_flags(self):
|
|
|
|
return []
|
|
|
|
|
2018-01-31 12:01:49 +00:00
|
|
|
def _get_mode_flags(self):
|
2017-12-12 21:33:16 +00:00
|
|
|
return []
|
|
|
|
|
2017-12-19 14:48:08 +00:00
|
|
|
def get_shell(self):
|
2019-02-05 14:00:49 +00:00
|
|
|
group, _ = self.path.split(os.path.sep, 1)
|
2017-12-12 21:33:16 +00:00
|
|
|
return 'v8_simple_%s_fuzzer' % group
|
|
|
|
|
|
|
|
|
2018-01-31 09:18:13 +00:00
|
|
|
def GetSuite(*args, **kwargs):
|
|
|
|
return TestSuite(*args, **kwargs)
|