[checker]: Dump the CFG when we fail.

Test: checker tests.
Bug: 147094528
Change-Id: Ia51a511b6528ebe7d624b26773f575e29d24954c
diff --git a/test/run-test b/test/run-test
index 188b38f..02aa07b 100755
--- a/test/run-test
+++ b/test/run-test
@@ -1076,7 +1076,12 @@
         echo '#################### info'
         cat "${td_info}" | sed 's/^/# /g'
         echo '#################### diffs'
-        diff --strip-trailing-cr -u "$expected" "$output" | tail -n 3000
+        if [ "$run_checker" == "yes" ]; then
+          # Checker failures dump the whole CFG, so we output the whole diff.
+          diff --strip-trailing-cr -u "$expected" "$output"
+        else
+          diff --strip-trailing-cr -u "$expected" "$output" | tail -n 3000
+        fi
         echo '####################'
         if [ "$strace" = "yes" ]; then
             echo '#################### strace output'
diff --git a/tools/checker/match/file.py b/tools/checker/match/file.py
index 520c4ae..3b2e67e 100644
--- a/tools/checker/match/file.py
+++ b/tools/checker/match/file.py
@@ -172,6 +172,8 @@
     # match a check group against the first output group of the same name.
     c1Pass = c1File.findPass(testCase.name)
     if c1Pass is None:
+      with file(c1File.fileName) as cfgFile:
+        Logger.log(''.join(cfgFile), Logger.Level.Error)
       Logger.fail("Test case not found in the CFG file",
                   testCase.fileName, testCase.startLineNo, testCase.name)
 
@@ -186,4 +188,6 @@
       else:
         msg = "Assertion could not be matched starting from line {}"
       msg = msg.format(lineNo)
+      with file(c1File.fileName) as cfgFile:
+        Logger.log(''.join(cfgFile), Logger.Level.Error)
       Logger.testFailed(msg, e.assertion, e.variables)