Commit: 52fb441c13771b21d3ab1b50fcadfe257346f264
Author: Brecht Van Lommel
Date:   Fri Jul 29 02:04:45 2016 +0200
Branches: master
https://developer.blender.org/rB52fb441c13771b21d3ab1b50fcadfe257346f264

Fix Cycles ctests not always deleting fail.png files on success.

===================================================================

M       tests/python/cycles_render_tests.py

===================================================================

diff --git a/tests/python/cycles_render_tests.py 
b/tests/python/cycles_render_tests.py
index e1b5e2d..1434447 100755
--- a/tests/python/cycles_render_tests.py
+++ b/tests/python/cycles_render_tests.py
@@ -66,15 +66,16 @@ def verify_output(filepath):
         )
     try:
         subprocess.check_output(command)
-        if os.path.exists(failed_image):
-            os.remove(failed_image)
-        return True
+        failed = False
     except subprocess.CalledProcessError as e:
-        if e.returncode != 1:
-            shutil.copy(TEMP_FILE, failed_image)
         if VERBOSE:
             print(e.output.decode("utf-8"))
-        return e.returncode == 1
+        failed = e.returncode != 1
+    if failed:
+        shutil.copy(TEMP_FILE, failed_image)
+    elif os.path.exists(failed_image):
+        os.remove(failed_image)
+    return not failed
 
 
 def run_test(filepath):

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to