6206a3e362
This shares logic for finding additional resources in JS source code. Previously the logic was implemented for mjsunit, now it will be used across all d8-based test cases. This'll enable adding those test suites for Android testing. Bug: chromium:866862 Cq-Include-Trybots: luci.v8.try:v8_linux_noi18n_rel_ng Change-Id: I7c89ba141483aaf692a03c0e168edb61bbb7b010 Reviewed-on: https://chromium-review.googlesource.com/1193873 Commit-Queue: Michael Achenbach <machenbach@chromium.org> Reviewed-by: Jakob Gruber <jgruber@chromium.org> Reviewed-by: Georg Neis <neis@chromium.org> Cr-Commit-Position: refs/heads/master@{#55503}
36 lines
1.0 KiB
Python
36 lines
1.0 KiB
Python
# 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
|
|
from testrunner.objects import testcase
|
|
|
|
class TestSuite(testsuite.TestSuite):
|
|
def ListTests(self):
|
|
tests = []
|
|
for dirname, dirs, files in os.walk(self.root):
|
|
for dotted in [x for x in dirs if x.startswith('.')]:
|
|
dirs.remove(dotted)
|
|
for filename in files:
|
|
if (filename.endswith(".js")):
|
|
fullpath = os.path.join(dirname, filename)
|
|
relpath = fullpath[len(self.root) + 1 : -3]
|
|
testname = relpath.replace(os.path.sep, "/")
|
|
test = self._create_test(testname)
|
|
tests.append(test)
|
|
return tests
|
|
|
|
def _test_class(self):
|
|
return TestCase
|
|
|
|
|
|
class TestCase(testcase.D8TestCase):
|
|
def _get_files_params(self):
|
|
return [os.path.join(self.suite.root, self.path + self._get_suffix())]
|
|
|
|
|
|
def GetSuite(*args, **kwargs):
|
|
return TestSuite(*args, **kwargs)
|