Commit 913d5ba5 authored by Clemens Hammacher's avatar Clemens Hammacher Committed by Commit Bot

Split message tests in failing and non-failing

This way, we can also check the return code of d8. We currently have a
bug (6981) which makes failing tests not being detected, even though
the failure message is (sometimes) being printed.
After this refactoring, we can write tests for our mjsunit test
functions.

R=machenbach@chromium.org

Bug: v8:6981
Change-Id: I0aa0abcb0f9a4f622a1e1d1a4d826da1e6eb4f07
Reviewed-on: https://chromium-review.googlesource.com/737991Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48951}
parent 98e26799
...@@ -4,4 +4,4 @@ ...@@ -4,4 +4,4 @@
// //
// MODULE // MODULE
import {a} from "../mjsunit/modules-skip-7.js"; import {a} from "../../mjsunit/modules-skip-7.js";
*%(basename)s:7: SyntaxError: The requested module contains conflicting star exports for name 'a' *%(basename)s:7: SyntaxError: The requested module contains conflicting star exports for name 'a'
import {a} from "../mjsunit/modules-skip-7.js"; import {a} from "../../mjsunit/modules-skip-7.js";
^ ^
SyntaxError: The requested module contains conflicting star exports for name 'a' SyntaxError: The requested module contains conflicting star exports for name 'a'
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// //
// MODULE // MODULE
export * from "../mjsunit/modules-skip-star-exports-conflict.js"; export * from "../../mjsunit/modules-skip-star-exports-conflict.js";
export * from "../mjsunit/modules-skip-6.js"; export * from "../../mjsunit/modules-skip-6.js";
import {a} from "modules-star-conflict2.js"; import {a} from "modules-star-conflict2.js";
*%(basename)s:7: SyntaxError: The requested module contains conflicting star exports for name 'a' *%(basename)s:7: SyntaxError: The requested module contains conflicting star exports for name 'a'
export * from "../mjsunit/modules-skip-star-exports-conflict.js"; export * from "../../mjsunit/modules-skip-star-exports-conflict.js";
^ ^
SyntaxError: The requested module contains conflicting star exports for name 'a' SyntaxError: The requested module contains conflicting star exports for name 'a'
...@@ -34,6 +34,6 @@ ...@@ -34,6 +34,6 @@
# Modules which are only meant to be imported from by other tests, not to be # Modules which are only meant to be imported from by other tests, not to be
# tested standalone. # tested standalone.
'modules-skip*': [SKIP], 'fail/modules-skip*': [SKIP],
}], # ALWAYS }], # ALWAYS
] ]
...@@ -88,9 +88,22 @@ class MessageTestSuite(testsuite.TestSuite): ...@@ -88,9 +88,22 @@ class MessageTestSuite(testsuite.TestSuite):
return (string.startswith("==") or string.startswith("**") or return (string.startswith("==") or string.startswith("**") or
string.startswith("ANDROID")) string.startswith("ANDROID"))
def _GetExpectedFail(self, testcase):
path = testcase.path
while path:
(head, tail) = os.path.split(path)
if tail == "fail":
return True
path = head
return False
def IsFailureOutput(self, testcase): def IsFailureOutput(self, testcase):
output = testcase.output output = testcase.output
testpath = testcase.path testpath = testcase.path
expected_fail = self._GetExpectedFail(testcase)
fail = testcase.output.exit_code != 0
if expected_fail != fail:
return True
expected_path = os.path.join(self.root, testpath + ".out") expected_path = os.path.join(self.root, testpath + ".out")
expected_lines = [] expected_lines = []
# Can't use utils.ReadLinesFrom() here because it strips whitespace. # Can't use utils.ReadLinesFrom() here because it strips whitespace.
......
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