From 52fb441c13771b21d3ab1b50fcadfe257346f264 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Fri, 29 Jul 2016 02:04:45 +0200 Subject: Fix Cycles ctests not always deleting fail.png files on success. --- tests/python/cycles_render_tests.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/python/cycles_render_tests.py') diff --git a/tests/python/cycles_render_tests.py b/tests/python/cycles_render_tests.py index e1b5e2d1d23..1434447416d 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): -- cgit v1.2.3