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

10
SUB_TESTS = [
11
  'inspector',
12 13 14
  'json',
  'parser',
  'regexp',
15
  'regexp_builtins',
16 17 18 19 20 21
  'multi_return',
  'wasm',
  'wasm_async',
  'wasm_code',
  'wasm_compile',
]
22

23 24 25 26 27
class VariantsGenerator(testsuite.VariantsGenerator):
  def _get_variants(self, test):
    return self._standard_variant


28 29 30 31 32 33 34 35
class TestLoader(testsuite.GenericTestLoader):
  @property
  def test_dirs(self):
    return SUB_TESTS

  def _to_relpath(self, abspath, _):
    return os.path.relpath(abspath, self.suite.root)

36 37
  def _should_filter_by_name(self, _):
    return False
38

39
class TestSuite(testsuite.TestSuite):
40 41
  def _test_loader_class(self):
    return TestLoader
42

43
  def _test_class(self):
44
    return TestCase
45

46 47 48
  def _variants_gen_class(self):
    return VariantsGenerator

49

50
class TestCase(testcase.TestCase):
51
  def _get_files_params(self):
52
    suite, name = self.path.split(os.path.sep)
53 54 55 56 57 58 59 60
    return [os.path.join(self.suite.root, suite, name)]

  def _get_variant_flags(self):
    return []

  def _get_statusfile_flags(self):
    return []

61
  def _get_mode_flags(self):
62 63
    return []

64
  def get_shell(self):
65
    group, _ = self.path.split(os.path.sep, 1)
66 67 68
    return 'v8_simple_%s_fuzzer' % group


69 70
def GetSuite(*args, **kwargs):
  return TestSuite(*args, **kwargs)