summaryrefslogtreecommitdiff
path: root/deps/v8/tools/clusterfuzz/v8_foozzie_test.py
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/tools/clusterfuzz/v8_foozzie_test.py')
-rwxr-xr-xdeps/v8/tools/clusterfuzz/v8_foozzie_test.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/deps/v8/tools/clusterfuzz/v8_foozzie_test.py b/deps/v8/tools/clusterfuzz/v8_foozzie_test.py
index 3b95111271..e9559f6e0c 100755
--- a/deps/v8/tools/clusterfuzz/v8_foozzie_test.py
+++ b/deps/v8/tools/clusterfuzz/v8_foozzie_test.py
@@ -113,10 +113,11 @@ otherfile.js: TypeError: undefined is not a constructor
def cut_verbose_output(stdout):
- return '\n'.join(stdout.split('\n')[2:])
+ # This removes first lines containing d8 commands.
+ return '\n'.join(stdout.split('\n')[4:])
-def run_foozzie(first_d8, second_d8):
+def run_foozzie(first_d8, second_d8, *extra_flags):
return subprocess.check_output([
sys.executable, FOOZZIE,
'--random-seed', '12345',
@@ -125,23 +126,31 @@ def run_foozzie(first_d8, second_d8):
'--first-config', 'ignition',
'--second-config', 'ignition_turbo',
os.path.join(TEST_DATA, 'fuzz-123.js'),
- ])
+ ] + list(extra_flags))
class SystemTest(unittest.TestCase):
def testSyntaxErrorDiffPass(self):
- stdout = run_foozzie('test_d8_1.py', 'test_d8_2.py')
+ stdout = run_foozzie('test_d8_1.py', 'test_d8_2.py', '--skip-sanity-checks')
self.assertEquals('# V8 correctness - pass\n', cut_verbose_output(stdout))
def testDifferentOutputFail(self):
with open(os.path.join(TEST_DATA, 'failure_output.txt')) as f:
expected_output = f.read()
with self.assertRaises(subprocess.CalledProcessError) as ctx:
- run_foozzie('test_d8_1.py', 'test_d8_3.py')
+ run_foozzie('test_d8_1.py', 'test_d8_3.py', '--skip-sanity-checks')
e = ctx.exception
self.assertEquals(v8_foozzie.RETURN_FAIL, e.returncode)
self.assertEquals(expected_output, cut_verbose_output(e.output))
+ def testSanityCheck(self):
+ with open(os.path.join(TEST_DATA, 'sanity_check_output.txt')) as f:
+ expected_output = f.read()
+ with self.assertRaises(subprocess.CalledProcessError) as ctx:
+ run_foozzie('test_d8_1.py', 'test_d8_3.py')
+ e = ctx.exception
+ self.assertEquals(v8_foozzie.RETURN_FAIL, e.returncode)
+ self.assertEquals(expected_output, e.output)
if __name__ == '__main__':
unittest.main()