Cleanup dead code in CPDF_DIBSource::LoadJpxBitmap() and friends.
[pdfium.git] / testing / tools / run_corpus_tests.py
index 13376f7..28616fb 100755 (executable)
@@ -42,6 +42,10 @@ def main():
   options, args = parser.parse_args()
   finder = common.DirectoryFinder(options.build_dir)
   pdfium_test_path = finder.ExecutablePath('pdfium_test')
+  if not os.path.exists(pdfium_test_path):
+    print "FAILURE: Can't find test executable '%s'" % pdfium_test_path
+    print "Use --build-dir to specify its location."
+    return 1
   working_dir = finder.WorkingDir(os.path.join('testing', 'corpus'))
   if not os.path.exists(working_dir):
     os.makedirs(working_dir)
@@ -51,6 +55,7 @@ def main():
 
   # test files are under .../pdfium/testing/corpus.
   failures = []
+  surprises = []
   walk_from_dir = finder.TestingDir('corpus');
   input_file_re = re.compile('^[a-zA-Z0-9_.]+[.]pdf$')
   for source_dir, _, filename_list in os.walk(walk_from_dir):
@@ -58,13 +63,23 @@ def main():
       if input_file_re.match(input_filename):
          input_path = os.path.join(source_dir, input_filename)
          if os.path.isfile(input_path):
+           result = test_one_file(input_filename, source_dir, working_dir,
+                                  pdfium_test_path, image_differ)
            if test_suppressor.IsSuppressed(input_filename):
-             continue
-         if not test_one_file(input_filename, source_dir, working_dir,
-                              pdfium_test_path, image_differ):
-             failures.append(input_path)
+             if result:
+               surprises.append(input_path)
+           else:
+             if not result:
+               failures.append(input_path)
+
+  if surprises:
+    surprises.sort()
+    print '\n\nUnexpected Successes:'
+    for surprise in surprises:
+      print surprise;
 
   if failures:
+    failures.sort()
     print '\n\nSummary of Failures:'
     for failure in failures:
       print failure