ART: Added comments, fixed typos in Checker
Change-Id: I1ff12940035845c1a586d4df826efc794088bdc9
diff --git a/tools/checker.py b/tools/checker.py
index 5e910ec..3d5ca45 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)
@@ -551,6 +551,11 @@
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)
@@ -578,6 +583,7 @@
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)
@@ -618,6 +624,11 @@
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
@@ -663,6 +674,7 @@
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)
diff --git a/tools/checker_test.py b/tools/checker_test.py
index 9b04ab0..9bdd0ad 100755
--- a/tools/checker_test.py
+++ b/tools/checker_test.py
@@ -23,7 +23,7 @@
# The parent type of exception expected to be thrown by Checker during tests.
# It must be specific enough to not cover exceptions thrown due to actual flaws
-# in Checker..
+# in Checker.
CheckerException = SystemExit