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

Unified Diff: tools/foozzie/v8_foozzie_test.py

Issue 2578503003: [foozzie] Initial correctness fuzzer harness. (Closed)
Patch Set: Presubmit Created 4 years 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 | « tools/foozzie/v8_foozzie.py ('k') | tools/foozzie/v8_mock.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/foozzie/v8_foozzie_test.py
diff --git a/tools/foozzie/v8_foozzie_test.py b/tools/foozzie/v8_foozzie_test.py
new file mode 100644
index 0000000000000000000000000000000000000000..de5516f80685e9fce35dd568c9666a9e3a3881f2
--- /dev/null
+++ b/tools/foozzie/v8_foozzie_test.py
@@ -0,0 +1,77 @@
+# 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 unittest
+
+import v8_suppressions
+
+class FuzzerTest(unittest.TestCase):
+ def testDiff(self):
+ # TODO(machenbach): Mock out suppression configuration.
+ suppress = v8_suppressions.get_suppression(
+ 'x64', 'fullcode', 'x64', 'default')
+ one = ''
+ two = ''
+ diff = None
+ self.assertEquals(diff, suppress.diff(one, two))
+
+ one = 'a \n b\nc();'
+ two = 'a \n b\nc();'
+ diff = None
+ self.assertEquals(diff, suppress.diff(one, two))
+
+ # Ignore line before caret, caret position, stack trace char numbers
+ # error message and validator output.
+ one = """
+undefined
+weird stuff
+ ^
+Validation of asm.js module failed: foo bar
+somefile.js: TypeError: undefined is not a function
+stack line :15: foo
+ undefined
+"""
+ two = """
+undefined
+other weird stuff
+ ^
+somefile.js: TypeError: baz is not a function
+stack line :2: foo
+Validation of asm.js module failed: baz
+ undefined
+"""
+ diff = None
+ self.assertEquals(diff, suppress.diff(one, two))
+
+ one = """
+Still equal
+Extra line
+"""
+ two = """
+Still equal
+"""
+ diff = '- Extra line'
+ self.assertEquals(diff, suppress.diff(one, two))
+
+ one = """
+Still equal
+"""
+ two = """
+Still equal
+Extra line
+"""
+ diff = '+ Extra line'
+ self.assertEquals(diff, suppress.diff(one, two))
+
+ one = """
+undefined
+somefile.js: TypeError: undefined is not a constructor
+"""
+ two = """
+undefined
+otherfile.js: TypeError: undefined is not a constructor
+"""
+ diff = """- somefile.js: TypeError: undefined is not a constructor
++ otherfile.js: TypeError: undefined is not a constructor"""
+ self.assertEquals(diff, suppress.diff(one, two))
« no previous file with comments | « tools/foozzie/v8_foozzie.py ('k') | tools/foozzie/v8_mock.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698