summaryrefslogtreecommitdiffstats
path: root/tools/checker.py
diff options
context:
space:
mode:
authorDavid Brazdil <dbrazdil@google.com>2015-01-09 19:21:16 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2015-01-09 19:21:16 +0000
commitb9b26e1b036308e18113e37dfa5b81a64d1a7bd4 (patch)
treeb52037e9bf3fa33ddb2511cae9e7c2dde98434e1 /tools/checker.py
parentf16344c79d3902460c05dd0e62f157e766ed1e0e (diff)
parent48942de205db678a1a74d953ae3288937b26834d (diff)
downloadart-b9b26e1b036308e18113e37dfa5b81a64d1a7bd4.zip
art-b9b26e1b036308e18113e37dfa5b81a64d1a7bd4.tar.gz
art-b9b26e1b036308e18113e37dfa5b81a64d1a7bd4.tar.bz2
Merge "ART: Added comments, fixed typos in Checker"
Diffstat (limited to 'tools/checker.py')
-rwxr-xr-xtools/checker.py14
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/checker.py b/tools/checker.py
index b1abea2..4561dd6 100755
--- a/tools/checker.py
+++ b/tools/checker.py
@@ -40,7 +40,7 @@
# later than lines matched against any preceeding in-order checks.
# In other words, the order of output lines does not matter
# between consecutive DAG checks.
-# - CHECK-NOT: Must not match any output line which appear in the output group
+# - CHECK-NOT: Must not match any output line which appears in the output group
# later than lines matched against any preceeding checks and
# earlier than lines matched against any subsequent checks.
# Surrounding non-negative checks (or boundaries of the group)
@@ -549,6 +549,11 @@ class CheckFile(FileSplitMixin):
else:
return None
+ # This function is invoked on each line of the check file and returns a pair
+ # which instructs the parser how the line should be handled. If the line is to
+ # be included in the current check group, it is returned in the first value.
+ # If the line starts a new check group, the name of the group is returned in
+ # the second value.
def _processLine(self, line, lineNo):
# Lines beginning with 'CHECK-START' start a new check group.
startLine = self._extractLine(self.prefix + "-START", line)
@@ -576,6 +581,7 @@ class CheckFile(FileSplitMixin):
def _exceptionLineOutsideGroup(self, line, lineNo):
Logger.fail("Check line not inside a group", self.fileName, lineNo)
+ # Constructs a check group from the parser-collected check lines.
def _processGroup(self, name, lines, lineNo):
checkLines = list(map(lambda line: CheckLine(line[0], line[1], self.fileName, line[2]), lines))
return CheckGroup(name, checkLines, self.fileName, lineNo)
@@ -616,6 +622,11 @@ class OutputFile(FileSplitMixin):
self.state = OutputFile.ParsingState.OutsideBlock
self.groups = self._parseStream(outputStream)
+ # This function is invoked on each line of the output file and returns a pair
+ # which instructs the parser how the line should be handled. If the line is to
+ # be included in the current group, it is returned in the first value. If the
+ # line starts a new output group, the name of the group is returned in the
+ # second value.
def _processLine(self, line, lineNo):
if self.state == OutputFile.ParsingState.StartingCfgBlock:
# Previous line started a new 'cfg' block which means that this one must
@@ -661,6 +672,7 @@ class OutputFile(FileSplitMixin):
else:
Logger.fail("Output line not inside a group", self.fileName, lineNo)
+ # Constructs an output group from the parser-collected output lines.
def _processGroup(self, name, lines, lineNo):
return OutputGroup(name, lines, self.fileName, lineNo + 1)