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
|
|
|
|
2017-12-13 12:47:24 +00:00
|
|
|
class TestSuite(testsuite.TestSuite):
|
2018-02-01 10:01:21 +00:00
|
|
|
def ListTests(self):
|
2017-04-27 12:28:05 +00:00
|
|
|
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, "/")
|
2017-12-12 21:33:16 +00:00
|
|
|
test = self._create_test(testname)
|
2017-04-27 12:28:05 +00:00
|
|
|
tests.append(test)
|
|
|
|
return tests
|
|
|
|
|
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
|
|
|
|
|
|
|
|
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):
|
2017-12-12 21:33:16 +00:00
|
|
|
return [os.path.join(self.suite.root, self.path + self._get_suffix())]
|
2017-04-27 12:28:05 +00:00
|
|
|
|
|
|
|
|
2018-01-31 09:18:13 +00:00
|
|
|
def GetSuite(*args, **kwargs):
|
|
|
|
return TestSuite(*args, **kwargs)
|