OLD | NEW |
1 # Copyright 2016 the V8 project authors. All rights reserved. | 1 # Copyright 2016 the V8 project authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import os | 5 import os |
6 import re | 6 import re |
7 | 7 |
8 from testrunner.local import testsuite | 8 from testrunner.local import testsuite |
9 from testrunner.objects import testcase | 9 from testrunner.objects import testcase |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 if (filename.endswith(".js") and filename != "test-api.js"): | 26 if (filename.endswith(".js") and filename != "test-api.js"): |
27 fullpath = os.path.join(dirname, filename) | 27 fullpath = os.path.join(dirname, filename) |
28 relpath = fullpath[len(self.root) + 1 : -3] | 28 relpath = fullpath[len(self.root) + 1 : -3] |
29 testname = relpath.replace(os.path.sep, "/") | 29 testname = relpath.replace(os.path.sep, "/") |
30 test = testcase.TestCase(self, testname) | 30 test = testcase.TestCase(self, testname) |
31 tests.append(test) | 31 tests.append(test) |
32 return tests | 32 return tests |
33 | 33 |
34 def GetFlagsForTestCase(self, testcase, context): | 34 def GetFlagsForTestCase(self, testcase, context): |
35 source = self.GetSourceForTest(testcase) | 35 source = self.GetSourceForTest(testcase) |
36 flags = ["--enable-inspector"] + context.mode_flags | 36 flags = ["--enable-inspector", "--allow-natives-syntax"] + context.mode_flag
s |
37 flags_match = re.findall(FLAGS_PATTERN, source) | 37 flags_match = re.findall(FLAGS_PATTERN, source) |
38 for match in flags_match: | 38 for match in flags_match: |
39 flags += match.strip().split() | 39 flags += match.strip().split() |
40 | 40 |
41 files = [] | 41 files = [] |
42 files.append(os.path.normpath(os.path.join(self.root, "..", "mjsunit", "mjsu
nit.js"))) | 42 files.append(os.path.normpath(os.path.join(self.root, "..", "mjsunit", "mjsu
nit.js"))) |
43 files.append(os.path.join(self.root, "test-api.js")) | 43 files.append(os.path.join(self.root, "test-api.js")) |
44 files.append(os.path.join(self.root, testcase.path + self.suffix())) | 44 files.append(os.path.join(self.root, testcase.path + self.suffix())) |
45 | 45 |
46 flags += files | 46 flags += files |
47 if context.isolates: | 47 if context.isolates: |
48 flags.append("--isolate") | 48 flags.append("--isolate") |
49 flags += files | 49 flags += files |
50 | 50 |
51 return testcase.flags + flags | 51 return testcase.flags + flags |
52 | 52 |
53 def GetSourceForTest(self, testcase): | 53 def GetSourceForTest(self, testcase): |
54 filename = os.path.join(self.root, testcase.path + self.suffix()) | 54 filename = os.path.join(self.root, testcase.path + self.suffix()) |
55 with open(filename) as f: | 55 with open(filename) as f: |
56 return f.read() | 56 return f.read() |
57 | 57 |
58 def GetSuite(name, root): | 58 def GetSuite(name, root): |
59 return DebuggerTestSuite(name, root) | 59 return DebuggerTestSuite(name, root) |
OLD | NEW |