OLD | NEW |
1 # Copyright 2008 the V8 project authors. All rights reserved. | 1 # Copyright 2008 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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 files.sort() | 52 files.sort() |
53 for filename in files: | 53 for filename in files: |
54 if filename.endswith(".js"): | 54 if filename.endswith(".js"): |
55 fullpath = os.path.join(dirname, filename) | 55 fullpath = os.path.join(dirname, filename) |
56 relpath = fullpath[len(self.root) + 1 : -3] | 56 relpath = fullpath[len(self.root) + 1 : -3] |
57 testname = relpath.replace(os.path.sep, "/") | 57 testname = relpath.replace(os.path.sep, "/") |
58 test = testcase.TestCase(self, testname) | 58 test = testcase.TestCase(self, testname) |
59 tests.append(test) | 59 tests.append(test) |
60 return tests | 60 return tests |
61 | 61 |
| 62 def CreateVariantGenerator(self, variants): |
| 63 return super(MessageTestSuite, self).CreateVariantGenerator( |
| 64 variants + ["preparser"]) |
| 65 |
62 def GetFlagsForTestCase(self, testcase, context): | 66 def GetFlagsForTestCase(self, testcase, context): |
63 source = self.GetSourceForTest(testcase) | 67 source = self.GetSourceForTest(testcase) |
64 result = [] | 68 result = [] |
65 flags_match = re.findall(FLAGS_PATTERN, source) | 69 flags_match = re.findall(FLAGS_PATTERN, source) |
66 for match in flags_match: | 70 for match in flags_match: |
67 result += match.strip().split() | 71 result += match.strip().split() |
68 result += context.mode_flags | 72 result += context.mode_flags |
69 if MODULE_PATTERN.search(source): | 73 if MODULE_PATTERN.search(source): |
70 result.append("--module") | 74 result.append("--module") |
71 result = [x for x in result if x not in INVALID_FLAGS] | 75 result = [x for x in result if x not in INVALID_FLAGS] |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 if not re.match(pattern, actual): | 115 if not re.match(pattern, actual): |
112 return True | 116 return True |
113 return False | 117 return False |
114 | 118 |
115 def StripOutputForTransmit(self, testcase): | 119 def StripOutputForTransmit(self, testcase): |
116 pass | 120 pass |
117 | 121 |
118 | 122 |
119 def GetSuite(name, root): | 123 def GetSuite(name, root): |
120 return MessageTestSuite(name, root) | 124 return MessageTestSuite(name, root) |
OLD | NEW |