Cycles tests: raise failure threshold, copy failed image for comparison.
authorBrecht Van Lommel <brechtvanlommel@gmail.com>
Mon, 13 Jun 2016 22:39:49 +0000 (00:39 +0200)
committerBrecht Van Lommel <brechtvanlommel@gmail.com>
Sun, 19 Jun 2016 18:17:26 +0000 (20:17 +0200)
tests/python/cycles_render_tests.py

index 36fad175cfa1fe9b5e6c78d0e087b045f4d8189a..fb9e63aa222cbfa21e4fe602a25dc5a9cc0ba4a0 100755 (executable)
@@ -3,6 +3,7 @@
 
 import argparse
 import os
+import shutil
 import subprocess
 import sys
 import tempfile
@@ -53,19 +54,23 @@ def verify_output(filepath):
     dirpath = os.path.dirname(filepath)
     reference_dirpath = os.path.join(dirpath, "reference_renders")
     reference_image = os.path.join(reference_dirpath, testname + ".png")
+    failed_image = os.path.join(reference_dirpath, testname + ".fail.png")
     if not os.path.exists(reference_image):
         return False
     command = (
         IDIFF,
-        "-fail", "0.01",
+        "-fail", "0.015",
         "-failpercent", "1",
         reference_image,
         TEMP_FILE,
         )
     try:
         subprocess.check_output(command)
+        if os.path.exists(failed_image):
+            os.remove(failed_image)
         return True
     except subprocess.CalledProcessError as e:
+        shutil.copy(TEMP_FILE, failed_image)
         if VERBOSE:
             print(e.output.decode("utf-8"))
         return e.returncode == 1