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/test.py b/tools/checker/match/test.py
index e4dd784..348c1d2 100644
--- a/tools/checker/match/test.py
+++ b/tools/checker/match/test.py
@@ -195,6 +195,54 @@
foo
""")
+ def test_NextLineAssertions(self):
+ self.assertMatches(
+ """
+ // CHECK: foo
+ // CHECK-NEXT: bar
+ // CHECK-NEXT: abc
+ // CHECK: def
+ """,
+ """
+ foo
+ bar
+ abc
+ def
+ """)
+ self.assertMatches(
+ """
+ // CHECK: foo
+ // CHECK-NEXT: bar
+ // CHECK: def
+ """,
+ """
+ foo
+ bar
+ abc
+ def
+ """)
+ self.assertDoesNotMatch(
+ """
+ // CHECK: foo
+ // CHECK-NEXT: bar
+ """,
+ """
+ foo
+ abc
+ bar
+ """)
+
+ self.assertDoesNotMatch(
+ """
+ // CHECK: foo
+ // CHECK-NEXT: bar
+ """,
+ """
+ bar
+ foo
+ abc
+ """)
+
def test_DagAssertions(self):
self.assertMatches(
"""