testcfg.py 1.66 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
class VariantsGenerator(testsuite.VariantsGenerator):
  def _get_variants(self, test):
    return self._standard_variant


16
class TestSuite(testsuite.TestSuite):
17
  SUB_TESTS = ( 'json', 'parser', 'regexp_builtins', 'regexp', 'multi_return', 'wasm',
18
          'wasm_async', 'wasm_code', 'wasm_compile',
19 20 21
          'wasm_data_section', 'wasm_function_sigs_section',
          'wasm_globals_section', 'wasm_imports_section', 'wasm_memory_section',
          'wasm_names_section', 'wasm_types_section' )
22

23
  def ListTests(self):
24
    tests = []
25
    for subtest in TestSuite.SUB_TESTS:
26 27 28
      for fname in os.listdir(os.path.join(self.root, subtest)):
        if not os.path.isfile(os.path.join(self.root, subtest, fname)):
          continue
29
        test = self._create_test('%s/%s' % (subtest, fname))
30 31 32 33
        tests.append(test)
    tests.sort()
    return tests

34
  def _test_class(self):
35
    return TestCase
36

37 38 39
  def _variants_gen_class(self):
    return VariantsGenerator

40

41
class TestCase(testcase.TestCase):
42
  def _get_files_params(self):
43 44 45 46 47 48 49 50 51
    suite, name = self.path.split('/')
    return [os.path.join(self.suite.root, suite, name)]

  def _get_variant_flags(self):
    return []

  def _get_statusfile_flags(self):
    return []

52
  def _get_mode_flags(self):
53 54
    return []

55
  def get_shell(self):
56 57 58 59
    group, _ = self.path.split('/', 1)
    return 'v8_simple_%s_fuzzer' % group


60 61
def GetSuite(*args, **kwargs):
  return TestSuite(*args, **kwargs)