ART: Implement next-line assertions in Checker
Some tests require verifying an exact sequence of lines in the graph
dump. This was already possible by inserting 'CHECK-NOT: {{.*}}'
between the individual lines, but hardly a convenient way of doing so.
This patch introduces a new 'CHECK-NEXT' kind of assertions that
replaces the old method and will become useful for testing assembly.
Change-Id: I1bb951707bda44320166dc7ef828866a6957a113
diff --git a/tools/checker/match/file.py b/tools/checker/match/file.py
index 6cff2bf..b22211a 100644
--- a/tools/checker/match/file.py
+++ b/tools/checker/match/file.py
@@ -127,6 +127,11 @@
assert len(assertionGroup) == 1
scope = MatchScope(matchFrom, c1Length)
match = findMatchingLine(assertionGroup[0], c1Pass, scope, variables)
+ elif assertionGroup[0].variant == TestAssertion.Variant.NextLine:
+ # Single next-line assertion. Test if the current line matches.
+ assert len(assertionGroup) == 1
+ scope = MatchScope(matchFrom, matchFrom + 1)
+ match = findMatchingLine(assertionGroup[0], c1Pass, scope, variables)
else:
# A group of DAG assertions. Match them all starting from the same point.
assert assertionGroup[0].variant == TestAssertion.Variant.DAG