OLD | NEW |
| (Empty) |
1 # Copyright 2017 the V8 project authors. All rights reserved. | |
2 # Use of this source code is governed by a BSD-style license that can be | |
3 # found in the LICENSE file. | |
4 | |
5 import os | |
6 import difflib | |
7 | |
8 from testrunner.local import testsuite | |
9 from testrunner.objects import testcase | |
10 | |
11 | |
12 class MkGrokdump(testsuite.TestSuite): | |
13 | |
14 def __init__(self, name, root): | |
15 super(MkGrokdump, self).__init__(name, root) | |
16 | |
17 def ListTests(self, context): | |
18 test = testcase.TestCase(self, self.shell()) | |
19 return [test] | |
20 | |
21 def GetFlagsForTestCase(self, testcase, context): | |
22 return [] | |
23 | |
24 def IsFailureOutput(self, testcase): | |
25 output = testcase.output | |
26 v8_path = os.path.dirname(os.path.dirname(os.path.abspath(self.root))) | |
27 expected_path = os.path.join(v8_path, "tools", "v8heapconst.py") | |
28 with open(expected_path) as f: | |
29 expected = f.read() | |
30 if expected != output.stdout: | |
31 if "generated from a non-shipping build" in output.stdout: | |
32 return False | |
33 assert "generated from a shipping build" in output.stdout | |
34 expected_lines = expected.splitlines(1) | |
35 actual_lines = output.stdout.splitlines(1) | |
36 output.stdout = ''.join(difflib.unified_diff(expected_lines, actual_lines)
) | |
37 return True | |
38 return False | |
39 | |
40 def shell(self): | |
41 return "mkgrokdump" | |
42 | |
43 def GetSuite(name, root): | |
44 return MkGrokdump(name, root) | |
OLD | NEW |