summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2015-01-08 01:49:53 +0000
committerDavid Brazdil <dbrazdil@google.com>2015-01-08 19:50:17 +0000
commit21df8898e239a46ebfb189b14668d216d5801a61 (patch)
tree860e17966d0fee6aa163f4d207cfa3a3790e9d3e /tools
parent7e1a34386368d2bb3dc89bf5aa0519cafc326095 (diff)
downloadart-21df8898e239a46ebfb189b14668d216d5801a61.zip
art-21df8898e239a46ebfb189b14668d216d5801a61.tar.gz
art-21df8898e239a46ebfb189b14668d216d5801a61.tar.bz2
ART: Fixed subsequent CHECK-NOTs Checker bug
Matching a group of CHECK-NOT lines caused Checker to crash due to incorrectly overwriting the varState variable. The second use of the variable was renamed and a regression test added. Change-Id: I1a879cf5368acca6b5092f69a9caa47b89a79532
Diffstat (limited to 'tools')
-rwxr-xr-xtools/checker.py4
-rwxr-xr-xtools/checker_test.py4
2 files changed, 6 insertions, 2 deletions
diff --git a/tools/checker.py b/tools/checker.py
index 5e910ec..0813d0c 100755
--- a/tools/checker.py
+++ b/tools/checker.py
@@ -440,9 +440,9 @@ class CheckGroup(CommonEqualityMixin):
def __matchNotLines(self, checkLines, outputLines, startLineNo, varState):
for checkLine in checkLines:
assert checkLine.variant == CheckLine.Variant.Not
- matchLineNo, varState = \
+ matchLineNo, matchVarState = \
self.__findFirstMatch(checkLine, outputLines, startLineNo, [], varState)
- if varState is not None:
+ if matchVarState is not None:
Logger.testFailed("CHECK-NOT line \"" + checkLine.content + "\" matches output line " + \
str(matchLineNo), self.fileName, checkLine.lineNo)
diff --git a/tools/checker_test.py b/tools/checker_test.py
index 9b04ab0..2846a9c 100755
--- a/tools/checker_test.py
+++ b/tools/checker_test.py
@@ -342,6 +342,10 @@ class TestCheckGroup_Match(unittest.TestCase):
self.__notMatchMulti([("foo", CheckVariant.Not)],
"""abc foo
def""")
+ self.__notMatchMulti([("foo", CheckVariant.Not),
+ ("bar", CheckVariant.Not)],
+ """abc
+ def bar""")
def test_LineOnlyMatchesOnce(self):
self.__matchMulti([("foo", CheckVariant.DAG),