Chromium Code Reviews| Index: test/test262/testcfg.py |
| diff --git a/test/test262/testcfg.py b/test/test262/testcfg.py |
| index 7b7001310b5513193faec824951daa5dede29068..1f8029deba9d0cdd4be35c726fdf21bdedd14070 100644 |
| --- a/test/test262/testcfg.py |
| +++ b/test/test262/testcfg.py |
| @@ -129,7 +129,8 @@ class Test262TestSuite(testsuite.TestSuite): |
| def GetFlagsForTestCase(self, testcase, context): |
| return (testcase.flags + context.mode_flags + self.harness + |
| self.GetIncludesForTest(testcase) + ["--harmony"] + |
| - [os.path.join(self.testroot, testcase.path + ".js")]) |
| + [os.path.join(self.testroot, testcase.path + ".js")] + |
| + (["--throws"] if "negative" in self.GetTestRecord(testcase) else [])) |
| def _VariantGeneratorFactory(self): |
| return Test262VariantGenerator |
| @@ -144,7 +145,7 @@ class Test262TestSuite(testsuite.TestSuite): |
| self.ParseTestRecord = module.parseTestRecord |
| except: |
| raise ImportError("Cannot load parseTestRecord; you may need to " |
| - "--download-data for test262") |
| + "gclient sync for test262") |
| finally: |
| if f: |
| f.close() |
| @@ -171,13 +172,19 @@ class Test262TestSuite(testsuite.TestSuite): |
| with open(filename) as f: |
| return f.read() |
| - def IsNegativeTest(self, testcase): |
| + def IsFailureOutput(self, testcase): |
| + output = testcase.output |
| test_record = self.GetTestRecord(testcase) |
| - return "negative" in test_record |
| - |
| - def IsFailureOutput(self, output, testpath): |
| if output.exit_code != 0: |
| return True |
| + if "negative" in test_record: |
| + exception = "" |
| + for line in output.stdout.split("\n")[::-1]: |
|
Michael Achenbach
2016/03/11 07:57:31
nit - readability: Maybe extract these four lines
Dan Ehrenberg
2016/03/14 21:00:05
Done
|
| + if line and not line[0].isspace() and ":" in line: |
| + exception = line.split(":")[0] |
| + break |
| + if exception != test_record["negative"]: |
| + return True |
| return "FAILED!" in output.stdout |
| def HasUnexpectedOutput(self, testcase): |