diff options
author | David Brazdil <dbrazdil@google.com> | 2015-01-07 21:19:50 +0000 |
---|---|---|
committer | David Brazdil <dbrazdil@google.com> | 2015-01-09 19:18:19 +0000 |
commit | 48942de205db678a1a74d953ae3288937b26834d (patch) | |
tree | b13d575581c2101a62a111e316bc9aa9f9a9fccf /tools | |
parent | 7e1a34386368d2bb3dc89bf5aa0519cafc326095 (diff) | |
download | art-48942de205db678a1a74d953ae3288937b26834d.zip art-48942de205db678a1a74d953ae3288937b26834d.tar.gz art-48942de205db678a1a74d953ae3288937b26834d.tar.bz2 |
ART: Added comments, fixed typos in Checker
Change-Id: I1ff12940035845c1a586d4df826efc794088bdc9
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/checker.py | 14 | ||||
-rwxr-xr-x | tools/checker_test.py | 2 |
2 files changed, 14 insertions, 2 deletions
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 @@ 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) @@ -578,6 +583,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) @@ -618,6 +624,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 @@ -663,6 +674,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) 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 @@ import unittest # 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 |