| OLD | NEW |
| 1 # Copyright 2012 the V8 project authors. All rights reserved. | 1 # Copyright 2012 the V8 project authors. All rights reserved. |
| 2 # Redistribution and use in source and binary forms, with or without | 2 # Redistribution and use in source and binary forms, with or without |
| 3 # modification, are permitted provided that the following conditions are | 3 # modification, are permitted provided that the following conditions are |
| 4 # met: | 4 # met: |
| 5 # | 5 # |
| 6 # * Redistributions of source code must retain the above copyright | 6 # * Redistributions of source code must retain the above copyright |
| 7 # notice, this list of conditions and the following disclaimer. | 7 # notice, this list of conditions and the following disclaimer. |
| 8 # * Redistributions in binary form must reproduce the above | 8 # * Redistributions in binary form must reproduce the above |
| 9 # copyright notice, this list of conditions and the following | 9 # copyright notice, this list of conditions and the following |
| 10 # disclaimer in the documentation and/or other materials provided | 10 # disclaimer in the documentation and/or other materials provided |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 | 100 |
| 101 class Test262TestSuite(testsuite.TestSuite): | 101 class Test262TestSuite(testsuite.TestSuite): |
| 102 | 102 |
| 103 def __init__(self, name, root): | 103 def __init__(self, name, root): |
| 104 super(Test262TestSuite, self).__init__(name, root) | 104 super(Test262TestSuite, self).__init__(name, root) |
| 105 self.testroot = os.path.join(self.root, *TEST_262_SUITE_PATH) | 105 self.testroot = os.path.join(self.root, *TEST_262_SUITE_PATH) |
| 106 self.harnesspath = os.path.join(self.root, *TEST_262_HARNESS_PATH) | 106 self.harnesspath = os.path.join(self.root, *TEST_262_HARNESS_PATH) |
| 107 self.harness = [os.path.join(self.harnesspath, f) | 107 self.harness = [os.path.join(self.harnesspath, f) |
| 108 for f in TEST_262_HARNESS_FILES] | 108 for f in TEST_262_HARNESS_FILES] |
| 109 self.harness += [os.path.join(self.root, "harness-adapt.js")] | 109 self.harness += [os.path.join(self.root, "harness-adapt.js")] |
| 110 self.ignition_filter = "--ignition-filter=" + self.testroot + "/*" |
| 110 self.ParseTestRecord = None | 111 self.ParseTestRecord = None |
| 111 | 112 |
| 112 def ListTests(self, context): | 113 def ListTests(self, context): |
| 113 tests = [] | 114 tests = [] |
| 114 for dirname, dirs, files in os.walk(self.testroot): | 115 for dirname, dirs, files in os.walk(self.testroot): |
| 115 for dotted in [x for x in dirs if x.startswith(".")]: | 116 for dotted in [x for x in dirs if x.startswith(".")]: |
| 116 dirs.remove(dotted) | 117 dirs.remove(dotted) |
| 117 if context.noi18n and "intl402" in dirs: | 118 if context.noi18n and "intl402" in dirs: |
| 118 dirs.remove("intl402") | 119 dirs.remove("intl402") |
| 119 dirs.sort() | 120 dirs.sort() |
| 120 files.sort() | 121 files.sort() |
| 121 for filename in files: | 122 for filename in files: |
| 122 if filename.endswith(".js"): | 123 if filename.endswith(".js"): |
| 123 fullpath = os.path.join(dirname, filename) | 124 fullpath = os.path.join(dirname, filename) |
| 124 relpath = fullpath[len(self.testroot) + 1 : -3] | 125 relpath = fullpath[len(self.testroot) + 1 : -3] |
| 125 testname = relpath.replace(os.path.sep, "/") | 126 testname = relpath.replace(os.path.sep, "/") |
| 126 case = testcase.TestCase(self, testname) | 127 case = testcase.TestCase(self, testname) |
| 127 tests.append(case) | 128 tests.append(case) |
| 128 return tests | 129 return tests |
| 129 | 130 |
| 130 def GetFlagsForTestCase(self, testcase, context): | 131 def GetFlagsForTestCase(self, testcase, context): |
| 131 return (testcase.flags + context.mode_flags + self.harness + | 132 # TODO(rmcilroy) Remove ignition filter modification once ignition can |
| 133 # support the test262 test harness code. |
| 134 flags = [ self.ignition_filter if "ignition-filter" in flag else flag |
| 135 for flag in testcase.flags] |
| 136 |
| 137 return (flags + context.mode_flags + self.harness + |
| 132 self.GetIncludesForTest(testcase) + ["--harmony"] + | 138 self.GetIncludesForTest(testcase) + ["--harmony"] + |
| 133 [os.path.join(self.testroot, testcase.path + ".js")]) | 139 [os.path.join(self.testroot, testcase.path + ".js")]) |
| 134 | 140 |
| 135 def _VariantGeneratorFactory(self): | 141 def _VariantGeneratorFactory(self): |
| 136 return Test262VariantGenerator | 142 return Test262VariantGenerator |
| 137 | 143 |
| 138 def LoadParseTestRecord(self): | 144 def LoadParseTestRecord(self): |
| 139 if not self.ParseTestRecord: | 145 if not self.ParseTestRecord: |
| 140 root = os.path.join(self.root, *TEST_262_TOOLS_PATH) | 146 root = os.path.join(self.root, *TEST_262_TOOLS_PATH) |
| 141 f = None | 147 f = None |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 # Magic incantation to allow longer path names on Windows. | 234 # Magic incantation to allow longer path names on Windows. |
| 229 archive.extractall(u"\\\\?\\%s" % self.root) | 235 archive.extractall(u"\\\\?\\%s" % self.root) |
| 230 else: | 236 else: |
| 231 archive.extractall(self.root) | 237 archive.extractall(self.root) |
| 232 os.rename(os.path.join(self.root, "tc39-test262-%s" % revision), | 238 os.rename(os.path.join(self.root, "tc39-test262-%s" % revision), |
| 233 directory_name) | 239 directory_name) |
| 234 | 240 |
| 235 | 241 |
| 236 def GetSuite(name, root): | 242 def GetSuite(name, root): |
| 237 return Test262TestSuite(name, root) | 243 return Test262TestSuite(name, root) |
| OLD | NEW |