MCPcopy Create free account
hub / github.com/nodejs/node / _ParseOutcomeList

Function _ParseOutcomeList

deps/v8/tools/testrunner/local/statusfile.py:193–233  ·  view source on GitHub ↗

Outcome list format: [condition, outcome, outcome, ...]

(rule, outcomes, variables, target_dict)

Source from the content-addressed store, hash-verified

191
192
193def _ParseOutcomeList(rule, outcomes, variables, target_dict):
194 """Outcome list format: [condition, outcome, outcome, ...]"""
195
196 result = set([])
197 if type(outcomes) == str:
198 outcomes = [outcomes]
199 for item in outcomes:
200 if type(item) == str:
201 result.add(item)
202 elif type(item) == list:
203 condition = item[0]
204 exp = _EvalExpression(condition, variables)
205 assert exp != VARIANT_EXPRESSION, (
206 "Nested variant expressions are not supported")
207 if exp is False:
208 continue
209
210 # Ensure nobody uses an identifier by mistake, like "default",
211 # which would evaluate to true here otherwise.
212 assert exp is True, "Make sure expressions evaluate to boolean values"
213
214 for outcome in item[1:]:
215 assert type(outcome) == str
216 result.add(outcome)
217 else:
218 assert False
219 if len(result) == 0:
220 return
221 if rule in target_dict:
222 # A FAIL without PASS in one rule has always precedence over a single
223 # PASS (without FAIL) in another. Otherwise the default PASS expectation
224 # in a rule with a modifier (e.g. PASS, SLOW) would be joined to a FAIL
225 # from another rule (which intended to mark a test as FAIL and not as
226 # PASS and FAIL).
227 if _JoinsPassAndFail(target_dict[rule], result):
228 target_dict[rule] -= set([PASS])
229 if _JoinsPassAndFail(result, target_dict[rule]):
230 result -= set([PASS])
231 target_dict[rule] |= result
232 else:
233 target_dict[rule] = result
234
235
236def ReadContent(content):

Callers 1

_ReadSectionFunction · 0.85

Calls 5

_EvalExpressionFunction · 0.85
_JoinsPassAndFailFunction · 0.85
addMethod · 0.65
setFunction · 0.50
typeFunction · 0.50

Tested by

no test coverage detected