testcfg.py 1.43 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 12 13 14 15 16 17 18 19 20 21
    'inspector',
    'json',
    'parser',
    'regexp',
    'regexp_builtins',
    'multi_return',
    'wasm',
    'wasm_async',
    'wasm_code',
    'wasm_compile',
    'wasm_streaming',
22
]
23

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


29 30 31 32 33 34 35 36
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)

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

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

44
  def _test_class(self):
45
    return TestCase
46

47 48 49
  def _variants_gen_class(self):
    return VariantsGenerator

50

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

  def _get_variant_flags(self):
    return []

  def _get_statusfile_flags(self):
    return []

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

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