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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 pass | 146 pass |
147 | 147 |
148 def ReadStatusFile(self, variables): | 148 def ReadStatusFile(self, variables): |
149 (self.rules, self.wildcards) = \ | 149 (self.rules, self.wildcards) = \ |
150 statusfile.ReadStatusFile(self.status_file(), variables) | 150 statusfile.ReadStatusFile(self.status_file(), variables) |
151 | 151 |
152 def ReadTestCases(self, context): | 152 def ReadTestCases(self, context): |
153 self.tests = self.ListTests(context) | 153 self.tests = self.ListTests(context) |
154 | 154 |
155 @staticmethod | 155 @staticmethod |
156 def _FilterFlaky(flaky, mode): | |
157 return (mode == "run" and not flaky) or (mode == "skip" and flaky) | |
158 | |
159 @staticmethod | |
160 def _FilterSlow(slow, mode): | 156 def _FilterSlow(slow, mode): |
161 return (mode == "run" and not slow) or (mode == "skip" and slow) | 157 return (mode == "run" and not slow) or (mode == "skip" and slow) |
162 | 158 |
163 @staticmethod | 159 @staticmethod |
164 def _FilterPassFail(pass_fail, mode): | 160 def _FilterPassFail(pass_fail, mode): |
165 return (mode == "run" and not pass_fail) or (mode == "skip" and pass_fail) | 161 return (mode == "run" and not pass_fail) or (mode == "skip" and pass_fail) |
166 | 162 |
167 def FilterTestCasesByStatus(self, warn_unused_rules, | 163 def FilterTestCasesByStatus(self, warn_unused_rules, |
168 flaky_tests="dontcare", | |
169 slow_tests="dontcare", | 164 slow_tests="dontcare", |
170 pass_fail_tests="dontcare"): | 165 pass_fail_tests="dontcare"): |
171 filtered = [] | 166 filtered = [] |
172 used_rules = set() | 167 used_rules = set() |
173 for t in self.tests: | 168 for t in self.tests: |
174 flaky = False | |
175 slow = False | 169 slow = False |
176 pass_fail = False | 170 pass_fail = False |
177 testname = self.CommonTestName(t) | 171 testname = self.CommonTestName(t) |
178 if testname in self.rules: | 172 if testname in self.rules: |
179 used_rules.add(testname) | 173 used_rules.add(testname) |
180 # Even for skipped tests, as the TestCase object stays around and | 174 # Even for skipped tests, as the TestCase object stays around and |
181 # PrintReport() uses it. | 175 # PrintReport() uses it. |
182 t.outcomes = self.rules[testname] | 176 t.outcomes = self.rules[testname] |
183 if statusfile.DoSkip(t.outcomes): | 177 if statusfile.DoSkip(t.outcomes): |
184 continue # Don't add skipped tests to |filtered|. | 178 continue # Don't add skipped tests to |filtered|. |
185 for outcome in t.outcomes: | 179 for outcome in t.outcomes: |
186 if outcome.startswith('Flags: '): | 180 if outcome.startswith('Flags: '): |
187 t.flags += outcome[7:].split() | 181 t.flags += outcome[7:].split() |
188 flaky = statusfile.IsFlaky(t.outcomes) | |
189 slow = statusfile.IsSlow(t.outcomes) | 182 slow = statusfile.IsSlow(t.outcomes) |
190 pass_fail = statusfile.IsPassOrFail(t.outcomes) | 183 pass_fail = statusfile.IsPassOrFail(t.outcomes) |
191 skip = False | 184 skip = False |
192 for rule in self.wildcards: | 185 for rule in self.wildcards: |
193 assert rule[-1] == '*' | 186 assert rule[-1] == '*' |
194 if testname.startswith(rule[:-1]): | 187 if testname.startswith(rule[:-1]): |
195 used_rules.add(rule) | 188 used_rules.add(rule) |
196 t.outcomes |= self.wildcards[rule] | 189 t.outcomes |= self.wildcards[rule] |
197 if statusfile.DoSkip(t.outcomes): | 190 if statusfile.DoSkip(t.outcomes): |
198 skip = True | 191 skip = True |
199 break # "for rule in self.wildcards" | 192 break # "for rule in self.wildcards" |
200 flaky = flaky or statusfile.IsFlaky(t.outcomes) | |
201 slow = slow or statusfile.IsSlow(t.outcomes) | 193 slow = slow or statusfile.IsSlow(t.outcomes) |
202 pass_fail = pass_fail or statusfile.IsPassOrFail(t.outcomes) | 194 pass_fail = pass_fail or statusfile.IsPassOrFail(t.outcomes) |
203 if (skip or self._FilterFlaky(flaky, flaky_tests) | 195 if (skip |
204 or self._FilterSlow(slow, slow_tests) | 196 or self._FilterSlow(slow, slow_tests) |
205 or self._FilterPassFail(pass_fail, pass_fail_tests)): | 197 or self._FilterPassFail(pass_fail, pass_fail_tests)): |
206 continue # "for t in self.tests" | 198 continue # "for t in self.tests" |
207 filtered.append(t) | 199 filtered.append(t) |
208 self.tests = filtered | 200 self.tests = filtered |
209 | 201 |
210 if not warn_unused_rules: | 202 if not warn_unused_rules: |
211 return | 203 return |
212 | 204 |
213 for rule in self.rules: | 205 for rule in self.rules: |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 return (testcase.flags + ["--gtest_filter=" + testcase.path] + | 323 return (testcase.flags + ["--gtest_filter=" + testcase.path] + |
332 ["--gtest_random_seed=%s" % context.random_seed] + | 324 ["--gtest_random_seed=%s" % context.random_seed] + |
333 ["--gtest_print_time=0"] + | 325 ["--gtest_print_time=0"] + |
334 context.mode_flags) | 326 context.mode_flags) |
335 | 327 |
336 def _VariantGeneratorFactory(self): | 328 def _VariantGeneratorFactory(self): |
337 return StandardVariantGenerator | 329 return StandardVariantGenerator |
338 | 330 |
339 def shell(self): | 331 def shell(self): |
340 return self.name | 332 return self.name |
OLD | NEW |