Chromium Code Reviews| Index: test/test262/testcfg.py |
| diff --git a/test/test262/testcfg.py b/test/test262/testcfg.py |
| index de3c9ad7b9f3645b7081806e137f133884ef3c31..15f88c7668d0e5e8bcc7c4833fb147c486300ec4 100644 |
| --- a/test/test262/testcfg.py |
| +++ b/test/test262/testcfg.py |
| @@ -36,19 +36,32 @@ from testrunner.local import testsuite |
| from testrunner.local import utils |
| from testrunner.objects import testcase |
| - |
| -TEST_262_ARCHIVE_REVISION = "fbba29f" # This is the r365 revision. |
| -TEST_262_ARCHIVE_MD5 = "e1ff0db438cc12de8fb6da80621b4ef6" |
| +TEST_262_ARCHIVE_REVISION = "595a36b" # This is the 2014-Aug-10 revision. |
| +TEST_262_ARCHIVE_MD5 = "89dfc8458f474cdb7e8e178f3215dd06" |
| TEST_262_URL = "https://github.com/tc39/test262/tarball/%s" |
| -TEST_262_HARNESS = ["sta.js", "testBuiltInObject.js", "testIntl.js"] |
| - |
| +TEST_262_HARNESS = ["sta.js"] |
| + |
| +TEST_262_ROOT = ["data", "test"] |
| +TEST_262_SUITE_ROOT = TEST_262_ROOT + ["suite"] |
| +TEST_262_HARNESS_ROOT = TEST_262_ROOT + ["harness"] |
| +TEST_262_PYTHON_ROOT = ["data", "tools", "packaging"] |
|
Jakob Kummerow
2014/08/18 17:18:39
Since this is now only used in the line right belo
smikes
2014/08/18 19:38:01
I think it can't go into GetSuite because GetSuite
|
| +TEST_262_PYTHON_PATH = os.path.join('test', 'test262', *TEST_262_PYTHON_ROOT) |
| + |
| +original_sys_path = sys.path |
| +sys.path.append(os.path.abspath(TEST_262_PYTHON_PATH)) |
| +try: |
| + from parseTestRecord import parseTestRecord as ParseTestRecord |
| +except ImportError: |
| + print "Need to --download-data for test262" |
| +sys.path = original_sys_path |
| class Test262TestSuite(testsuite.TestSuite): |
| def __init__(self, name, root): |
| super(Test262TestSuite, self).__init__(name, root) |
| - self.testroot = os.path.join(root, "data", "test", "suite") |
| - self.harness = [os.path.join(self.root, "data", "test", "harness", f) |
| + self.testroot = os.path.join(self.root, *TEST_262_SUITE_ROOT) |
| + self.harnesspath = os.path.join(self.root, *TEST_262_HARNESS_ROOT) |
| + self.harness = [os.path.join(self.harnesspath, f) |
| for f in TEST_262_HARNESS] |
| self.harness += [os.path.join(self.root, "harness-adapt.js")] |
| @@ -74,15 +87,34 @@ class Test262TestSuite(testsuite.TestSuite): |
| def GetFlagsForTestCase(self, testcase, context): |
| return (testcase.flags + context.mode_flags + self.harness + |
| + self.GetIncludesForTest(testcase) + |
| [os.path.join(self.testroot, testcase.path + ".js")]) |
| + def GetTestRecord(self, testcase): |
| + if hasattr(testcase, "test_record"): |
|
Jakob Kummerow
2014/08/18 17:18:39
nit: one return statement is more readable, and in
smikes
2014/08/18 19:38:01
Done.
|
| + return testcase.test_record |
| + testcase.test_record = ParseTestRecord(self.GetSourceForTest(testcase), |
| + testcase.path) |
| + return testcase.test_record |
| + |
| + def GetIncludesForTest(self, testcase): |
| + test_record = self.GetTestRecord(testcase) |
| + if "includes" in test_record: |
| + return [os.path.join(self.harnesspath, f) |
| + for f in test_record['includes']] |
| + return [] |
| + |
| def GetSourceForTest(self, testcase): |
| filename = os.path.join(self.testroot, testcase.path + ".js") |
| with open(filename) as f: |
| - return f.read() |
| + testcase.source = f.read() |
| + return testcase.source |
| def IsNegativeTest(self, testcase): |
| - return "@negative" in self.GetSourceForTest(testcase) |
| + test_record = self.GetTestRecord(testcase) |
| + if "negative" in test_record: |
| + return test_record['negative'] |
|
Jakob Kummerow
2014/08/18 17:18:39
one more nit: the rest of this file uses double qu
smikes
2014/08/18 19:38:01
Done.
|
| + return False |
| def IsFailureOutput(self, output, testpath): |
| if output.exit_code != 0: |