testcfg.py 1.38 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 11 12 13 14 15 16 17 18 19 20
SUB_TESTS = [
  'json',
  'parser',
  'regexp_builtins',
  'regexp',
  'multi_return',
  'wasm',
  'wasm_async',
  'wasm_code',
  'wasm_compile',
]
21

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


27 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
class TestSuite(testsuite.TestSuite):
37 38
  def _test_loader_class(self):
    return TestLoader
39

40
  def _test_class(self):
41
    return TestCase
42

43 44 45
  def _variants_gen_class(self):
    return VariantsGenerator

46

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

  def _get_variant_flags(self):
    return []

  def _get_statusfile_flags(self):
    return []

58
  def _get_mode_flags(self):
59 60
    return []

61
  def get_shell(self):
62
    group, _ = self.path.split(os.path.sep, 1)
63 64 65
    return 'v8_simple_%s_fuzzer' % group


66 67
def GetSuite(*args, **kwargs):
  return TestSuite(*args, **kwargs)