2016-12-23 16:30:57 +01: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
|
|
|
|
from testrunner.local import utils
|
|
|
|
from testrunner.objects import testcase
|
2018-03-07 08:54:53 +01:00
|
|
|
from testrunner.outproc import base as outproc
|
2016-12-23 16:30:57 +01:00
|
|
|
|
|
|
|
PROTOCOL_TEST_JS = "protocol-test.js"
|
2020-10-15 20:17:08 +02:00
|
|
|
WASM_INSPECTOR_JS = "wasm-inspector-test.js"
|
2023-03-30 12:11:08 +02:00
|
|
|
PRIVATE_MEMBER_TEST_JS = "private-class-member-inspector-test.js"
|
2016-12-23 16:30:57 +01:00
|
|
|
EXPECTED_SUFFIX = "-expected.txt"
|
2017-06-06 10:28:14 +02:00
|
|
|
RESOURCES_FOLDER = "resources"
|
2016-12-23 16:30:57 +01:00
|
|
|
|
2022-09-21 13:28:42 +02:00
|
|
|
|
2019-03-15 18:35:06 +05:30
|
|
|
class TestLoader(testsuite.JSTestLoader):
|
|
|
|
@property
|
|
|
|
def excluded_files(self):
|
2023-03-30 12:11:08 +02:00
|
|
|
return {PROTOCOL_TEST_JS, WASM_INSPECTOR_JS, PRIVATE_MEMBER_TEST_JS}
|
2019-03-15 18:35:06 +05:30
|
|
|
|
|
|
|
@property
|
|
|
|
def excluded_dirs(self):
|
|
|
|
return {RESOURCES_FOLDER}
|
|
|
|
|
|
|
|
|
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-12-23 16:30:57 +01:00
|
|
|
|
2018-03-07 08:54:53 +01:00
|
|
|
def _test_class(self):
|
|
|
|
return TestCase
|
2018-01-24 20:16:06 +01:00
|
|
|
|
2016-12-23 16:30:57 +01:00
|
|
|
|
2018-03-07 08:54:53 +01:00
|
|
|
class TestCase(testcase.TestCase):
|
|
|
|
def __init__(self, *args, **kwargs):
|
|
|
|
super(TestCase, self).__init__(*args, **kwargs)
|
2016-12-23 16:30:57 +01:00
|
|
|
|
2018-03-07 08:54:53 +01:00
|
|
|
self._source_flags = self._parse_source_flags()
|
2016-12-23 16:30:57 +01:00
|
|
|
|
2018-04-10 21:39:51 -04:00
|
|
|
def _get_files_params(self):
|
2018-03-07 08:54:53 +01:00
|
|
|
return [
|
2023-10-05 08:46:07 +02:00
|
|
|
self.suite.root / PROTOCOL_TEST_JS,
|
|
|
|
self.suite.root / self.path_js,
|
2018-03-07 08:54:53 +01:00
|
|
|
]
|
|
|
|
|
|
|
|
def _get_source_flags(self):
|
|
|
|
return self._source_flags
|
2016-12-23 16:30:57 +01:00
|
|
|
|
2018-03-07 08:54:53 +01:00
|
|
|
def _get_source_path(self):
|
2023-10-05 08:46:07 +02:00
|
|
|
return self.suite.root / self.path_js
|
2016-12-23 16:30:57 +01:00
|
|
|
|
2018-03-07 08:54:53 +01:00
|
|
|
def get_shell(self):
|
|
|
|
return 'inspector-test'
|
2016-12-23 16:30:57 +01:00
|
|
|
|
2023-03-30 12:11:08 +02:00
|
|
|
def get_android_resources(self):
|
|
|
|
super_resources = super().get_android_resources()
|
|
|
|
return super_resources + [
|
2023-10-05 08:46:07 +02:00
|
|
|
self.suite.root /'debugger' /'resources' /'break-locations.js',
|
|
|
|
self.suite.root / WASM_INSPECTOR_JS,
|
2018-12-04 08:20:37 +01:00
|
|
|
]
|
|
|
|
|
2018-03-07 08:54:53 +01:00
|
|
|
@property
|
|
|
|
def output_proc(self):
|
|
|
|
return outproc.ExpectedOutProc(
|
|
|
|
self.expected_outcomes,
|
2023-10-05 08:46:07 +02:00
|
|
|
self.suite.root / self.path_and_suffix(EXPECTED_SUFFIX),
|
2023-03-30 12:11:08 +02:00
|
|
|
self.test_config.regenerate_expected_files)
|