Commit 2d3eb1ba authored by Michal Majewski's avatar Michal Majewski Committed by Commit Bot

[test] Output processor for mkgrokdump

Bug: v8:6917
Change-Id: I36ab28500742ae1b906f806e0afb477059eb0380
Reviewed-on: https://chromium-review.googlesource.com/836548
Commit-Queue: Michał Majewski <majeski@google.com>
Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Cr-Commit-Position: refs/heads/master@{#50242}
parent b43550b7
...@@ -6,12 +6,20 @@ import os ...@@ -6,12 +6,20 @@ import os
import difflib import difflib
from testrunner.local import testsuite from testrunner.local import testsuite
from testrunner.objects import outproc
from testrunner.objects import testcase from testrunner.objects import testcase
SHELL = 'mkgrokdump' SHELL = 'mkgrokdump'
class TestSuite(testsuite.TestSuite): class TestSuite(testsuite.TestSuite):
def __init__(self, *args, **kwargs):
super(TestSuite, self).__init__(*args, **kwargs)
v8_path = os.path.dirname(os.path.dirname(os.path.abspath(self.root)))
expected_path = os.path.join(v8_path, 'tools', 'v8heapconst.py')
self.out_proc = OutProc(expected_path)
def ListTests(self, context): def ListTests(self, context):
test = self._create_test(SHELL) test = self._create_test(SHELL)
return [test] return [test]
...@@ -19,10 +27,30 @@ class TestSuite(testsuite.TestSuite): ...@@ -19,10 +27,30 @@ class TestSuite(testsuite.TestSuite):
def _test_class(self): def _test_class(self):
return TestCase return TestCase
def IsFailureOutput(self, test, output):
v8_path = os.path.dirname(os.path.dirname(os.path.abspath(self.root))) class TestCase(testcase.TestCase):
expected_path = os.path.join(v8_path, "tools", "v8heapconst.py") def _get_variant_flags(self):
with open(expected_path) as f: return []
def _get_statusfile_flags(self):
return []
def _get_mode_flags(self, ctx):
return []
def get_shell(self):
return SHELL
def get_output_proc(self):
return self.suite.out_proc
class OutProc(outproc.OutProc):
def __init__(self, expected_path):
self._expected_path = expected_path
def _is_failure_output(self, output):
with open(self._expected_path) as f:
expected = f.read() expected = f.read()
expected_lines = expected.splitlines() expected_lines = expected.splitlines()
actual_lines = output.stdout.splitlines() actual_lines = output.stdout.splitlines()
...@@ -39,19 +67,8 @@ class TestSuite(testsuite.TestSuite): ...@@ -39,19 +67,8 @@ class TestSuite(testsuite.TestSuite):
return True return True
return False return False
def _is_negative(self):
class TestCase(testcase.TestCase): return False
def _get_variant_flags(self):
return []
def _get_statusfile_flags(self):
return []
def _get_mode_flags(self, ctx):
return []
def get_shell(self):
return SHELL
def GetSuite(name, root): def GetSuite(name, root):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment