testcfg.py 1.24 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
from testrunner.outproc import mkgrokdump
10 11


12 13
SHELL = 'mkgrokdump'

14 15

class TestLoader(testsuite.TestLoader):
16 17
  def _list_test_filenames(self):
    yield SHELL
18 19

#TODO(tmrts): refactor the test creation logic to migrate to TestLoader
20
class TestSuite(testsuite.TestSuite):
21 22 23 24
  def __init__(self, *args, **kwargs):
    super(TestSuite, self).__init__(*args, **kwargs)

    v8_path = os.path.dirname(os.path.dirname(os.path.abspath(self.root)))
25
    self.expected_path = os.path.join(v8_path, 'tools', 'v8heapconst.py')
26

27 28 29
  def _test_loader_class(self):
    return TestLoader

30
  def _test_class(self):
31
    return TestCase
32

33 34 35 36 37 38 39 40

class TestCase(testcase.TestCase):
  def _get_variant_flags(self):
    return []

  def _get_statusfile_flags(self):
    return []

41
  def _get_mode_flags(self):
42 43 44 45 46
    return []

  def get_shell(self):
    return SHELL

47 48
  @property
  def output_proc(self):
49
    return mkgrokdump.OutProc(self.expected_outcomes, self.suite.expected_path)
50

51

52 53
def GetSuite(*args, **kwargs):
  return TestSuite(*args, **kwargs)