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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
108 class Test262TestSuite(testsuite.TestSuite): | 108 class Test262TestSuite(testsuite.TestSuite): |
109 # Match the (...) in '/path/to/v8/test/test262/subdir/test/(...).js' | 109 # Match the (...) in '/path/to/v8/test/test262/subdir/test/(...).js' |
110 # In practice, subdir is data or local-tests | 110 # In practice, subdir is data or local-tests |
111 | 111 |
112 def __init__(self, name, root): | 112 def __init__(self, name, root): |
113 super(Test262TestSuite, self).__init__(name, root) | 113 super(Test262TestSuite, self).__init__(name, root) |
114 self.testroot = os.path.join(self.root, *TEST_262_SUITE_PATH) | 114 self.testroot = os.path.join(self.root, *TEST_262_SUITE_PATH) |
115 self.harnesspath = os.path.join(self.root, *TEST_262_HARNESS_PATH) | 115 self.harnesspath = os.path.join(self.root, *TEST_262_HARNESS_PATH) |
116 self.harness = [os.path.join(self.harnesspath, f) | 116 self.harness = [os.path.join(self.harnesspath, f) |
117 for f in TEST_262_HARNESS_FILES] | 117 for f in TEST_262_HARNESS_FILES] |
118 self.harness += [os.path.join(self.root, "harness-adapt.js")] | 118 self.harness += [os.path.join(self.root, "harness-adapt.js"), |
119 os.path.join(self.root, "harness-agent.js")] | |
Dan Ehrenberg
2017/01/28 03:41:06
It would be nice if you could avoid including this
binji
2017/02/18 01:07:59
Done.
| |
119 self.localtestroot = os.path.join(self.root, *TEST_262_LOCAL_TESTS_PATH) | 120 self.localtestroot = os.path.join(self.root, *TEST_262_LOCAL_TESTS_PATH) |
120 self.ParseTestRecord = None | 121 self.ParseTestRecord = None |
121 | 122 |
122 def ListTests(self, context): | 123 def ListTests(self, context): |
123 tests = [] | 124 tests = [] |
124 testnames = set() | 125 testnames = set() |
125 for dirname, dirs, files in itertools.chain(os.walk(self.testroot), | 126 for dirname, dirs, files in itertools.chain(os.walk(self.testroot), |
126 os.walk(self.localtestroot)): | 127 os.walk(self.localtestroot)): |
127 for dotted in [x for x in dirs if x.startswith(".")]: | 128 for dotted in [x for x in dirs if x.startswith(".")]: |
128 dirs.remove(dotted) | 129 dirs.remove(dotted) |
(...skipping 15 matching lines...) Expand all Loading... | |
144 return (testcase.flags + context.mode_flags + self.harness + | 145 return (testcase.flags + context.mode_flags + self.harness + |
145 self.GetIncludesForTest(testcase) + | 146 self.GetIncludesForTest(testcase) + |
146 (["--module"] if "module" in self.GetTestRecord(testcase) else []) + | 147 (["--module"] if "module" in self.GetTestRecord(testcase) else []) + |
147 [self.GetPathForTest(testcase)] + | 148 [self.GetPathForTest(testcase)] + |
148 (["--throws"] if "negative" in self.GetTestRecord(testcase) | 149 (["--throws"] if "negative" in self.GetTestRecord(testcase) |
149 else []) + | 150 else []) + |
150 (["--allow-natives-syntax"] | 151 (["--allow-natives-syntax"] |
151 if "detachArrayBuffer.js" in | 152 if "detachArrayBuffer.js" in |
152 self.GetTestRecord(testcase).get("includes", []) | 153 self.GetTestRecord(testcase).get("includes", []) |
153 else []) + | 154 else []) + |
155 (["--harmony-sharedarraybuffer"]) + | |
Dan Ehrenberg
2017/01/28 03:41:06
It would be nice to avoid passing this flag for te
binji
2017/02/18 01:07:59
Done.
| |
154 ([flag for flag in testcase.outcomes if flag.startswith("--")])) | 156 ([flag for flag in testcase.outcomes if flag.startswith("--")])) |
155 | 157 |
156 def _VariantGeneratorFactory(self): | 158 def _VariantGeneratorFactory(self): |
157 return Test262VariantGenerator | 159 return Test262VariantGenerator |
158 | 160 |
159 def LoadParseTestRecord(self): | 161 def LoadParseTestRecord(self): |
160 if not self.ParseTestRecord: | 162 if not self.ParseTestRecord: |
161 root = os.path.join(self.root, *TEST_262_TOOLS_PATH) | 163 root = os.path.join(self.root, *TEST_262_TOOLS_PATH) |
162 f = None | 164 f = None |
163 try: | 165 try: |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
231 # data folder. | 233 # data folder. |
232 if os.path.exists(ARCHIVE) and not os.path.exists(DATA): | 234 if os.path.exists(ARCHIVE) and not os.path.exists(DATA): |
233 print "Extracting archive..." | 235 print "Extracting archive..." |
234 tar = tarfile.open(ARCHIVE) | 236 tar = tarfile.open(ARCHIVE) |
235 tar.extractall(path=os.path.dirname(ARCHIVE)) | 237 tar.extractall(path=os.path.dirname(ARCHIVE)) |
236 tar.close() | 238 tar.close() |
237 | 239 |
238 | 240 |
239 def GetSuite(name, root): | 241 def GetSuite(name, root): |
240 return Test262TestSuite(name, root) | 242 return Test262TestSuite(name, root) |
OLD | NEW |