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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 fullpath = os.path.join(dirname, filename) | 122 fullpath = os.path.join(dirname, filename) |
123 relpath = fullpath[len(self.testroot) + 1 : -3] | 123 relpath = fullpath[len(self.testroot) + 1 : -3] |
124 testname = relpath.replace(os.path.sep, "/") | 124 testname = relpath.replace(os.path.sep, "/") |
125 case = testcase.TestCase(self, testname) | 125 case = testcase.TestCase(self, testname) |
126 tests.append(case) | 126 tests.append(case) |
127 return tests | 127 return tests |
128 | 128 |
129 def GetFlagsForTestCase(self, testcase, context): | 129 def GetFlagsForTestCase(self, testcase, context): |
130 return (testcase.flags + context.mode_flags + self.harness + | 130 return (testcase.flags + context.mode_flags + self.harness + |
131 self.GetIncludesForTest(testcase) + ["--harmony"] + | 131 self.GetIncludesForTest(testcase) + ["--harmony"] + |
| 132 (["--module"] if "module" in self.GetTestRecord(testcase) else []) + |
132 [os.path.join(self.testroot, testcase.path + ".js")] + | 133 [os.path.join(self.testroot, testcase.path + ".js")] + |
133 (["--throws"] if "negative" in self.GetTestRecord(testcase) else [])
) | 134 (["--throws"] if "negative" in self.GetTestRecord(testcase) else [])
) |
134 | 135 |
135 def _VariantGeneratorFactory(self): | 136 def _VariantGeneratorFactory(self): |
136 return Test262VariantGenerator | 137 return Test262VariantGenerator |
137 | 138 |
138 def LoadParseTestRecord(self): | 139 def LoadParseTestRecord(self): |
139 if not self.ParseTestRecord: | 140 if not self.ParseTestRecord: |
140 root = os.path.join(self.root, *TEST_262_TOOLS_PATH) | 141 root = os.path.join(self.root, *TEST_262_TOOLS_PATH) |
141 f = None | 142 f = None |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 # data folder. | 215 # data folder. |
215 if os.path.exists(ARCHIVE) and not os.path.exists(DATA): | 216 if os.path.exists(ARCHIVE) and not os.path.exists(DATA): |
216 print "Extracting archive..." | 217 print "Extracting archive..." |
217 tar = tarfile.open(ARCHIVE) | 218 tar = tarfile.open(ARCHIVE) |
218 tar.extractall(path=os.path.dirname(ARCHIVE)) | 219 tar.extractall(path=os.path.dirname(ARCHIVE)) |
219 tar.close() | 220 tar.close() |
220 | 221 |
221 | 222 |
222 def GetSuite(name, root): | 223 def GetSuite(name, root): |
223 return Test262TestSuite(name, root) | 224 return Test262TestSuite(name, root) |
OLD | NEW |