Added better logging for our blackbox tests. It now displays the number of images...
authordswitkin <dswitkin@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 21 May 2009 21:18:27 +0000 (21:18 +0000)
committerdswitkin <dswitkin@59b500cc-1b3d-0410-9834-0bbf25fbcc57>
Thu, 21 May 2009 21:18:27 +0000 (21:18 +0000)
git-svn-id: http://zxing.googlecode.com/svn/trunk@947 59b500cc-1b3d-0410-9834-0bbf25fbcc57

core/test/src/com/google/zxing/common/AbstractBlackBoxTestCase.java

index 16dc1bb..fec39a0 100644 (file)
@@ -156,6 +156,8 @@ public abstract class AbstractBlackBoxTestCase extends TestCase {
     }
 
     // Print the results of all tests first
+    int totalFound = 0;
+    int totalMustPass = 0;
     for (int x = 0; x < testCount; x++) {
       System.out.println("Rotation " + testResults.get(x).getRotation() + " degrees:");
       System.out.println("  " + passedCounts[x] + " of " + imageFiles.length + " images passed ("
@@ -163,6 +165,17 @@ public abstract class AbstractBlackBoxTestCase extends TestCase {
       System.out.println("  " + tryHarderCounts[x] + " of " + imageFiles.length +
           " images passed with try harder (" + testResults.get(x).getTryHarderCount() +
           " required)");
+      totalFound += passedCounts[x];
+      totalFound += tryHarderCounts[x];
+      totalMustPass += testResults.get(x).getMustPassCount();
+      totalMustPass += testResults.get(x).getTryHarderCount();
+    }
+
+    int totalTests = imageFiles.length * testCount * 2;
+    System.out.println("TOTALS:\n  Decoded " + totalFound + " images out of " + totalTests +
+      " (" + (totalFound * 100 / totalTests) + "%)");
+    if (totalFound > totalMustPass) {
+      System.out.println("  *** Test too lax by " + (totalFound - totalMustPass) + " images");
     }
 
     // Then run through again and assert if any failed