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 itertools | 5 import itertools |
6 import os | 6 import os |
7 import re | 7 import re |
8 | 8 |
9 from testrunner.local import testsuite | 9 from testrunner.local import testsuite |
10 from testrunner.local import utils | 10 from testrunner.local import utils |
(...skipping 26 matching lines...) Expand all Loading... | |
37 | 37 |
38 def GetFlagsForTestCase(self, testcase, context): | 38 def GetFlagsForTestCase(self, testcase, context): |
39 source = self.GetSourceForTest(testcase) | 39 source = self.GetSourceForTest(testcase) |
40 flags_match = re.findall(FLAGS_PATTERN, source) | 40 flags_match = re.findall(FLAGS_PATTERN, source) |
41 flags = [] | 41 flags = [] |
42 for match in flags_match: | 42 for match in flags_match: |
43 flags += match.strip().split() | 43 flags += match.strip().split() |
44 testname = testcase.path.split(os.path.sep)[-1] | 44 testname = testcase.path.split(os.path.sep)[-1] |
45 testfilename = os.path.join(self.root, testcase.path + self.suffix()) | 45 testfilename = os.path.join(self.root, testcase.path + self.suffix()) |
46 protocoltestfilename = os.path.join(self.root, PROTOCOL_TEST_JS) | 46 protocoltestfilename = os.path.join(self.root, PROTOCOL_TEST_JS) |
47 return [ protocoltestfilename, testfilename ] + flags | 47 return flags + [ protocoltestfilename, testfilename ] |
Yang
2016/10/17 09:08:13
Can we have a separate way of adding additional te
Clemens Hammacher
2016/10/17 09:41:04
Yeah, probably a good idea. This way we can also f
| |
48 | 48 |
49 def GetSourceForTest(self, testcase): | 49 def GetSourceForTest(self, testcase): |
50 filename = os.path.join(self.root, testcase.path + self.suffix()) | 50 filename = os.path.join(self.root, testcase.path + self.suffix()) |
51 with open(filename) as f: | 51 with open(filename) as f: |
52 return f.read() | 52 return f.read() |
53 | 53 |
54 def shell(self): | 54 def shell(self): |
55 return "inspector-test" | 55 return "inspector-test" |
56 | 56 |
57 def _IgnoreLine(self, string): | 57 def _IgnoreLine(self, string): |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 | 100 |
101 for act_iterator in ActBlockIterator(): | 101 for act_iterator in ActBlockIterator(): |
102 for (expected, actual) in itertools.izip_longest( | 102 for (expected, actual) in itertools.izip_longest( |
103 ExpIterator(), act_iterator, fillvalue=''): | 103 ExpIterator(), act_iterator, fillvalue=''): |
104 if expected != actual: | 104 if expected != actual: |
105 return True | 105 return True |
106 return False | 106 return False |
107 | 107 |
108 def GetSuite(name, root): | 108 def GetSuite(name, root): |
109 return InspectorProtocolTestSuite(name, root) | 109 return InspectorProtocolTestSuite(name, root) |
OLD | NEW |