diff --git a/tests/python/cycles_render_tests.py b/tests/python/cycles_render_tests.py index 0b90ab5b55f..77bee4953ba 100755 --- a/tests/python/cycles_render_tests.py +++ b/tests/python/cycles_render_tests.py @@ -114,16 +114,27 @@ def test_get_name(filepath): def test_get_images(filepath): testname = test_get_name(filepath) dirpath = os.path.dirname(filepath) - ref_dirpath = os.path.join(dirpath, "reference_renders") + + old_dirpath = os.path.join(dirpath, "reference_renders") + old_img = os.path.join(old_dirpath, testname + ".png") + + ref_dirpath = os.path.join(OUTDIR, os.path.basename(dirpath), "ref") ref_img = os.path.join(ref_dirpath, testname + ".png") + if not os.path.exists(ref_dirpath): + os.makedirs(ref_dirpath) + if os.path.exists(old_img): + shutil.copy(old_img, ref_img) + new_dirpath = os.path.join(OUTDIR, os.path.basename(dirpath)) if not os.path.exists(new_dirpath): os.makedirs(new_dirpath) new_img = os.path.join(new_dirpath, testname + ".png") + diff_dirpath = os.path.join(OUTDIR, os.path.basename(dirpath), "diff") if not os.path.exists(diff_dirpath): os.makedirs(diff_dirpath) diff_img = os.path.join(diff_dirpath, testname + ".diff.png") + return ref_img, new_img, diff_img @@ -162,7 +173,7 @@ class Report: