Skip to content

Commit

Permalink
tools: support != in test status files
Browse files Browse the repository at this point in the history
PR-URL: #52766
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
  • Loading branch information
joyeecheung authored and targos committed May 11, 2024
1 parent c40a827 commit 1600bda
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,9 @@ def Evaluate(self, env, defs):
return self.left.Evaluate(env, defs) or self.right.Evaluate(env, defs)
elif self.op == 'if':
return False
elif self.op == '!=':
inter = self.left.GetOutcomes(env, defs) != self.right.GetOutcomes(env, defs)
return bool(inter)
elif self.op == '==':
inter = self.left.GetOutcomes(env, defs) & self.right.GetOutcomes(env, defs)
return bool(inter)
Expand Down Expand Up @@ -1128,6 +1131,9 @@ def Tokenize(self):
elif self.Current(2) == '==':
self.AddToken('==')
self.Advance(2)
elif self.Current(2) == '!=':
self.AddToken('!=')
self.Advance(2)
else:
return None
return self.tokens
Expand Down Expand Up @@ -1180,7 +1186,7 @@ def ParseAtomicExpression(scan):
return None


BINARIES = ['==']
BINARIES = ['==', '!=']
def ParseOperatorExpression(scan):
left = ParseAtomicExpression(scan)
if not left: return None
Expand Down

0 comments on commit 1600bda

Please sign in to comment.