testcfg.py 1.03 KB
Newer Older
1 2 3 4 5 6 7
# 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
8
from testrunner.objects import testcase
9

10
class TestSuite(testsuite.TestSuite):
11
  def ListTests(self):
12 13 14 15 16 17 18 19 20
    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, "/")
21
          test = self._create_test(testname)
22 23 24
          tests.append(test)
    return tests

25
  def _test_class(self):
26
    return TestCase
27 28


29
class TestCase(testcase.D8TestCase):
30
  def _get_files_params(self):
31
    return [os.path.join(self.suite.root, self.path + self._get_suffix())]
32 33


34 35
def GetSuite(*args, **kwargs):
  return TestSuite(*args, **kwargs)