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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 class Test262TestSuite(testsuite.TestSuite): | 97 class Test262TestSuite(testsuite.TestSuite): |
98 | 98 |
99 def __init__(self, name, root): | 99 def __init__(self, name, root): |
100 super(Test262TestSuite, self).__init__(name, root) | 100 super(Test262TestSuite, self).__init__(name, root) |
101 self.testroot = os.path.join(self.root, *TEST_262_SUITE_PATH) | 101 self.testroot = os.path.join(self.root, *TEST_262_SUITE_PATH) |
102 self.harnesspath = os.path.join(self.root, *TEST_262_HARNESS_PATH) | 102 self.harnesspath = os.path.join(self.root, *TEST_262_HARNESS_PATH) |
103 self.harness = [os.path.join(self.harnesspath, f) | 103 self.harness = [os.path.join(self.harnesspath, f) |
104 for f in TEST_262_HARNESS_FILES] | 104 for f in TEST_262_HARNESS_FILES] |
105 self.harness += [os.path.join(self.root, "harness-adapt.js")] | 105 self.harness += [os.path.join(self.root, "harness-adapt.js")] |
106 self.ignition_script_filter = "--ignition-script-filter=" + self.testroot | |
107 self.ParseTestRecord = None | 106 self.ParseTestRecord = None |
108 | 107 |
109 def ListTests(self, context): | 108 def ListTests(self, context): |
110 tests = [] | 109 tests = [] |
111 for dirname, dirs, files in os.walk(self.testroot): | 110 for dirname, dirs, files in os.walk(self.testroot): |
112 for dotted in [x for x in dirs if x.startswith(".")]: | 111 for dotted in [x for x in dirs if x.startswith(".")]: |
113 dirs.remove(dotted) | 112 dirs.remove(dotted) |
114 if context.noi18n and "intl402" in dirs: | 113 if context.noi18n and "intl402" in dirs: |
115 dirs.remove("intl402") | 114 dirs.remove("intl402") |
116 dirs.sort() | 115 dirs.sort() |
117 files.sort() | 116 files.sort() |
118 for filename in files: | 117 for filename in files: |
119 if filename.endswith(".js"): | 118 if filename.endswith(".js"): |
120 fullpath = os.path.join(dirname, filename) | 119 fullpath = os.path.join(dirname, filename) |
121 relpath = fullpath[len(self.testroot) + 1 : -3] | 120 relpath = fullpath[len(self.testroot) + 1 : -3] |
122 testname = relpath.replace(os.path.sep, "/") | 121 testname = relpath.replace(os.path.sep, "/") |
123 case = testcase.TestCase(self, testname) | 122 case = testcase.TestCase(self, testname) |
124 tests.append(case) | 123 tests.append(case) |
125 return tests | 124 return tests |
126 | 125 |
127 def GetFlagsForTestCase(self, testcase, context): | 126 def GetFlagsForTestCase(self, testcase, context): |
128 # TODO(rmcilroy) Remove ignition filter modification once ignition can | 127 return (testcase.flags + context.mode_flags + self.harness + |
129 # support the test262 test harness code. | |
130 flags = testcase.flags | |
131 if '--ignition' in flags: | |
132 flags += [self.ignition_script_filter, "--ignition-fake-try-catch"] | |
133 | |
134 return (flags + context.mode_flags + self.harness + | |
135 self.GetIncludesForTest(testcase) + ["--harmony"] + | 128 self.GetIncludesForTest(testcase) + ["--harmony"] + |
136 [os.path.join(self.testroot, testcase.path + ".js")]) | 129 [os.path.join(self.testroot, testcase.path + ".js")]) |
137 | 130 |
138 def _VariantGeneratorFactory(self): | 131 def _VariantGeneratorFactory(self): |
139 return Test262VariantGenerator | 132 return Test262VariantGenerator |
140 | 133 |
141 def LoadParseTestRecord(self): | 134 def LoadParseTestRecord(self): |
142 if not self.ParseTestRecord: | 135 if not self.ParseTestRecord: |
143 root = os.path.join(self.root, *TEST_262_TOOLS_PATH) | 136 root = os.path.join(self.root, *TEST_262_TOOLS_PATH) |
144 f = None | 137 f = None |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 archive_files = [f for f in os.listdir(self.root) | 195 archive_files = [f for f in os.listdir(self.root) |
203 if f.startswith("tc39-test262-")] | 196 if f.startswith("tc39-test262-")] |
204 if len(archive_files) > 0: | 197 if len(archive_files) > 0: |
205 print "Clobber outdated test archives ..." | 198 print "Clobber outdated test archives ..." |
206 for f in archive_files: | 199 for f in archive_files: |
207 os.remove(os.path.join(self.root, f)) | 200 os.remove(os.path.join(self.root, f)) |
208 | 201 |
209 | 202 |
210 def GetSuite(name, root): | 203 def GetSuite(name, root): |
211 return Test262TestSuite(name, root) | 204 return Test262TestSuite(name, root) |
OLD | NEW |