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

Unified Diff: test/test262/testcfg.py

Issue 1766503002: Make test262 test runner check for which exception is thrown (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Better factoring Created 4 years, 9 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/simdjs/testcfg.py ('k') | test/webkit/testcfg.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/test262/testcfg.py
diff --git a/test/test262/testcfg.py b/test/test262/testcfg.py
index 7b7001310b5513193faec824951daa5dede29068..bf007bd46ffabfaab1fba04e54fa4c5f026d5f81 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,20 @@ class Test262TestSuite(testsuite.TestSuite):
with open(filename) as f:
return f.read()
- def IsNegativeTest(self, testcase):
- test_record = self.GetTestRecord(testcase)
- return "negative" in test_record
+ def _ParseException(self, str):
+ for line in str.split("\n")[::-1]:
+ if line and not line[0].isspace() and ":" in line:
+ return line.split(":")[0]
+
- def IsFailureOutput(self, output, testpath):
+ def IsFailureOutput(self, testcase):
+ output = testcase.output
+ test_record = self.GetTestRecord(testcase)
if output.exit_code != 0:
return True
+ if "negative" in test_record:
+ if self._ParseException(output.stdout) != test_record["negative"]:
+ return True
return "FAILED!" in output.stdout
def HasUnexpectedOutput(self, testcase):
« no previous file with comments | « test/simdjs/testcfg.py ('k') | test/webkit/testcfg.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698