Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1393)

Unified Diff: test/mkgrokdump/testcfg.py

Issue 2809653003: Introduce mkgrokdump to update tools/v8heapconst.py. (Closed)
Patch Set: remove infra hack Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mkgrokdump/mkgrokdump.status ('k') | tools/run-tests.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mkgrokdump/testcfg.py
diff --git a/test/mkgrokdump/testcfg.py b/test/mkgrokdump/testcfg.py
new file mode 100644
index 0000000000000000000000000000000000000000..c47b59de4a7446b34197c9fa153e2ff7c3678aeb
--- /dev/null
+++ b/test/mkgrokdump/testcfg.py
@@ -0,0 +1,49 @@
+# 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
+import difflib
+
+from testrunner.local import testsuite
+from testrunner.objects import testcase
+
+
+class MkGrokdump(testsuite.TestSuite):
+
+ def __init__(self, name, root):
+ super(MkGrokdump, self).__init__(name, root)
+
+ def ListTests(self, context):
+ test = testcase.TestCase(self, self.shell())
+ return [test]
+
+ def GetFlagsForTestCase(self, testcase, context):
+ return []
+
+ def IsFailureOutput(self, testcase):
+ output = testcase.output
+ v8_path = os.path.dirname(os.path.dirname(os.path.abspath(self.root)))
+ expected_path = os.path.join(v8_path, "tools", "v8heapconst.py")
+ with open(expected_path) as f:
+ expected = f.read()
+ expected_lines = expected.splitlines()
+ actual_lines = output.stdout.splitlines()
+ diff = difflib.unified_diff(expected_lines, actual_lines, lineterm="",
+ fromfile="expected_path")
+ diffstring = '\n'.join(diff)
+ if diffstring is not "":
+ if "generated from a non-shipping build" in output.stdout:
+ return False
+ if not "generated from a shipping build" in output.stdout:
+ output.stdout = "Unexpected output:\n\n" + output.stdout
+ return True
+ output.stdout = diffstring
+ return True
+ return False
+
+ def shell(self):
+ return "mkgrokdump"
+
+def GetSuite(name, root):
+ return MkGrokdump(name, root)
« no previous file with comments | « test/mkgrokdump/mkgrokdump.status ('k') | tools/run-tests.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698