Chromium Code Reviews| Index: test/test262/testcfg.py |
| diff --git a/test/test262/testcfg.py b/test/test262/testcfg.py |
| index b62e9b0d6b4ffbe99ccb95de871713db440c3e30..9d7ff1314f896a25e4c445a51479914c9a4ea571 100644 |
| --- a/test/test262/testcfg.py |
| +++ b/test/test262/testcfg.py |
| @@ -33,6 +33,14 @@ import shutil |
| import sys |
| import tarfile |
| +# add parent dir to search path |
| +sys.path.append(os.path.dirname(os.path.abspath(__file__))) |
| + |
| +try: |
| + from harness import parseTestRecord |
| +except: |
| + raise ImportError("Cannot load parseTestRecord; you may need to " |
|
adamk
2016/06/22 21:54:07
Not sure this is worthwhile. If I patch in this ch
Dan Ehrenberg
2016/06/22 21:56:38
Good point; removed this.
|
| + "gclient sync for test262") |
| from testrunner.local import statusfile |
| from testrunner.local import testsuite |
| @@ -46,8 +54,7 @@ TEST_262_HARNESS_FILES = ["sta.js", "assert.js"] |
| TEST_262_NATIVE_FILES = ["detachArrayBuffer.js"] |
| TEST_262_SUITE_PATH = ["data", "test"] |
| -TEST_262_HARNESS_PATH = ["data", "harness"] |
| -TEST_262_TOOLS_PATH = ["data", "tools", "packaging"] |
| +TEST_262_INCLUDES_PATH = ["data", "harness"] |
| ALL_VARIANT_FLAGS_STRICT = dict( |
| (v, [flags + ["--use-strict"] for flags in flag_sets]) |
| @@ -103,11 +110,10 @@ class Test262TestSuite(testsuite.TestSuite): |
| def __init__(self, name, root): |
| super(Test262TestSuite, self).__init__(name, root) |
| self.testroot = os.path.join(self.root, *TEST_262_SUITE_PATH) |
| - self.harnesspath = os.path.join(self.root, *TEST_262_HARNESS_PATH) |
| + self.harnesspath = os.path.join(self.root, *TEST_262_INCLUDES_PATH) |
| self.harness = [os.path.join(self.harnesspath, f) |
| for f in TEST_262_HARNESS_FILES] |
| self.harness += [os.path.join(self.root, "harness-adapt.js")] |
| - self.ParseTestRecord = None |
| def ListTests(self, context): |
| tests = [] |
| @@ -119,7 +125,8 @@ class Test262TestSuite(testsuite.TestSuite): |
| dirs.sort() |
| files.sort() |
| for filename in files: |
| - if filename.endswith(".js"): |
| + # _FIXTURE files are just to be imported by modules, not direct tests |
| + if filename.endswith(".js") and not filename.endswith("_FIXTURE.js"): |
| fullpath = os.path.join(dirname, filename) |
| relpath = fullpath[len(self.testroot) + 1 : -3] |
| testname = relpath.replace(os.path.sep, "/") |
| @@ -142,26 +149,10 @@ class Test262TestSuite(testsuite.TestSuite): |
| def _VariantGeneratorFactory(self): |
| return Test262VariantGenerator |
| - def LoadParseTestRecord(self): |
| - if not self.ParseTestRecord: |
| - root = os.path.join(self.root, *TEST_262_TOOLS_PATH) |
| - f = None |
| - try: |
| - (f, pathname, description) = imp.find_module("parseTestRecord", [root]) |
| - module = imp.load_module("parseTestRecord", f, pathname, description) |
| - self.ParseTestRecord = module.parseTestRecord |
| - except: |
| - raise ImportError("Cannot load parseTestRecord; you may need to " |
| - "gclient sync for test262") |
| - finally: |
| - if f: |
| - f.close() |
| - return self.ParseTestRecord |
| def GetTestRecord(self, testcase): |
| if not hasattr(testcase, "test_record"): |
| - ParseTestRecord = self.LoadParseTestRecord() |
| - testcase.test_record = ParseTestRecord(self.GetSourceForTest(testcase), |
| + testcase.test_record = parseTestRecord(self.GetSourceForTest(testcase), |
| testcase.path) |
| return testcase.test_record |