2016-04-07 14:06:55 -07: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.
|
|
|
|
|
|
|
|
from testrunner.local import testsuite
|
|
|
|
from testrunner.objects import testcase
|
2025-04-29 08:03:15 +02:00
|
|
|
from testrunner.outproc import fuzzer
|
2016-04-07 14:06:55 -07:00
|
|
|
|
2019-03-15 18:35:06 +05:30
|
|
|
SUB_TESTS = [
|
2022-09-21 13:28:42 +02:00
|
|
|
'inspector',
|
|
|
|
'json',
|
|
|
|
'parser',
|
|
|
|
'regexp',
|
|
|
|
'regexp_builtins',
|
|
|
|
'multi_return',
|
2025-04-29 08:03:15 +02:00
|
|
|
'wasm/module',
|
|
|
|
'wasm/async',
|
|
|
|
'wasm/code',
|
|
|
|
'wasm/compile',
|
|
|
|
'wasm/compile_all',
|
|
|
|
'wasm/compile_simd',
|
|
|
|
'wasm/compile_wasmgc',
|
|
|
|
'wasm/init_expr',
|
|
|
|
'wasm/streaming',
|
2019-03-15 18:35:06 +05:30
|
|
|
]
|
2016-04-07 14:06:55 -07:00
|
|
|
|
2025-04-29 08:03:15 +02:00
|
|
|
|
2018-03-07 08:54:53 +01:00
|
|
|
class VariantsGenerator(testsuite.VariantsGenerator):
|
|
|
|
def _get_variants(self, test):
|
|
|
|
return self._standard_variant
|
2016-04-07 14:06:55 -07:00
|
|
|
|
|
|
|
|
2019-03-15 18:35:06 +05:30
|
|
|
class TestLoader(testsuite.GenericTestLoader):
|
|
|
|
@property
|
|
|
|
def test_dirs(self):
|
|
|
|
return SUB_TESTS
|
|
|
|
|
|
|
|
def _to_relpath(self, abspath, _):
|
2023-10-05 08:46:07 +02:00
|
|
|
return abspath.relative_to(self.suite.root)
|
2019-03-15 18:35:06 +05:30
|
|
|
|
2020-10-15 20:17:08 +02:00
|
|
|
def _should_filter_by_name(self, _):
|
|
|
|
return False
|
2019-03-15 18:35:06 +05:30
|
|
|
|
2018-03-07 08:54:53 +01:00
|
|
|
class TestSuite(testsuite.TestSuite):
|
2019-03-15 18:35:06 +05:30
|
|
|
def _test_loader_class(self):
|
|
|
|
return TestLoader
|
2016-04-07 14:06:55 -07:00
|
|
|
|
2018-03-07 08:54:53 +01:00
|
|
|
def _test_class(self):
|
|
|
|
return TestCase
|
|
|
|
|
|
|
|
def _variants_gen_class(self):
|
|
|
|
return VariantsGenerator
|
|
|
|
|
|
|
|
class TestCase(testcase.TestCase):
|
2018-04-10 21:39:51 -04:00
|
|
|
def _get_files_params(self):
|
2023-10-05 08:46:07 +02:00
|
|
|
return [self.suite.root / self.path]
|
2018-03-07 08:54:53 +01:00
|
|
|
|
|
|
|
def _get_variant_flags(self):
|
|
|
|
return []
|
|
|
|
|
|
|
|
def _get_statusfile_flags(self):
|
|
|
|
return []
|
|
|
|
|
2018-04-10 21:39:51 -04:00
|
|
|
def _get_mode_flags(self):
|
2018-03-07 08:54:53 +01:00
|
|
|
return []
|
|
|
|
|
|
|
|
def get_shell(self):
|
2025-04-29 08:03:15 +02:00
|
|
|
fuzzer_name = '_'.join(self.path.parts[:-1])
|
|
|
|
return f'v8_simple_{fuzzer_name}_fuzzer'
|
|
|
|
|
|
|
|
@property
|
|
|
|
def output_proc(self):
|
|
|
|
return fuzzer.OutProc(self.expected_outcomes)
|