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=s:" + self.testroot | 110 self.ignition_script_filter = "--ignition-script-filter=" + self.testroot |
111 self.ParseTestRecord = None | 111 self.ParseTestRecord = None |
112 | 112 |
113 def ListTests(self, context): | 113 def ListTests(self, context): |
114 tests = [] | 114 tests = [] |
115 for dirname, dirs, files in os.walk(self.testroot): | 115 for dirname, dirs, files in os.walk(self.testroot): |
116 for dotted in [x for x in dirs if x.startswith(".")]: | 116 for dotted in [x for x in dirs if x.startswith(".")]: |
117 dirs.remove(dotted) | 117 dirs.remove(dotted) |
118 if context.noi18n and "intl402" in dirs: | 118 if context.noi18n and "intl402" in dirs: |
119 dirs.remove("intl402") | 119 dirs.remove("intl402") |
120 dirs.sort() | 120 dirs.sort() |
121 files.sort() | 121 files.sort() |
122 for filename in files: | 122 for filename in files: |
123 if filename.endswith(".js"): | 123 if filename.endswith(".js"): |
124 fullpath = os.path.join(dirname, filename) | 124 fullpath = os.path.join(dirname, filename) |
125 relpath = fullpath[len(self.testroot) + 1 : -3] | 125 relpath = fullpath[len(self.testroot) + 1 : -3] |
126 testname = relpath.replace(os.path.sep, "/") | 126 testname = relpath.replace(os.path.sep, "/") |
127 case = testcase.TestCase(self, testname) | 127 case = testcase.TestCase(self, testname) |
128 tests.append(case) | 128 tests.append(case) |
129 return tests | 129 return tests |
130 | 130 |
131 def GetFlagsForTestCase(self, testcase, context): | 131 def GetFlagsForTestCase(self, testcase, context): |
132 # TODO(rmcilroy) Remove ignition filter modification once ignition can | 132 # TODO(rmcilroy) Remove ignition filter modification once ignition can |
133 # support the test262 test harness code. | 133 # support the test262 test harness code. |
134 flags = [ self.ignition_filter if "ignition-filter" in flag else flag | 134 flags = testcase.flags |
135 for flag in testcase.flags] | 135 if '--ignition' in flags: |
| 136 flags += [self.ignition_script_filter] |
136 | 137 |
137 return (flags + context.mode_flags + self.harness + | 138 return (flags + context.mode_flags + self.harness + |
138 self.GetIncludesForTest(testcase) + ["--harmony"] + | 139 self.GetIncludesForTest(testcase) + ["--harmony"] + |
139 [os.path.join(self.testroot, testcase.path + ".js")]) | 140 [os.path.join(self.testroot, testcase.path + ".js")]) |
140 | 141 |
141 def _VariantGeneratorFactory(self): | 142 def _VariantGeneratorFactory(self): |
142 return Test262VariantGenerator | 143 return Test262VariantGenerator |
143 | 144 |
144 def LoadParseTestRecord(self): | 145 def LoadParseTestRecord(self): |
145 if not self.ParseTestRecord: | 146 if not self.ParseTestRecord: |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 # Magic incantation to allow longer path names on Windows. | 235 # Magic incantation to allow longer path names on Windows. |
235 archive.extractall(u"\\\\?\\%s" % self.root) | 236 archive.extractall(u"\\\\?\\%s" % self.root) |
236 else: | 237 else: |
237 archive.extractall(self.root) | 238 archive.extractall(self.root) |
238 os.rename(os.path.join(self.root, "tc39-test262-%s" % revision), | 239 os.rename(os.path.join(self.root, "tc39-test262-%s" % revision), |
239 directory_name) | 240 directory_name) |
240 | 241 |
241 | 242 |
242 def GetSuite(name, root): | 243 def GetSuite(name, root): |
243 return Test262TestSuite(name, root) | 244 return Test262TestSuite(name, root) |
OLD | NEW |