[Tests] Relaxed the test_render_3d_variant_1 test

- Having problems with new KiCad 6 images
This commit is contained in:
Salvador E. Tropea 2023-03-14 11:32:55 -03:00
parent 31cf802b89
commit 6eb631d5bd
5 changed files with 5 additions and 2 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

After

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

After

Width:  |  Height:  |  Size: 123 KiB

View File

@ -151,7 +151,7 @@ def test_render_3d_variant_1(test_dir):
# Check all outputs are there
name = prj+'-3D_top.png'
ctx.expect_out_file(name)
ctx.compare_image(name, fuzz='8%', tol=1000)
ctx.compare_image(name, fuzz='48%', tol=1000, trim=True)
ctx.clean_up(keep_project=True)

View File

@ -486,7 +486,7 @@ class TestContext(object):
return self.search_not_in_file(os.path.join(self.sub_dir, file), texts)
def compare_image(self, image, reference=None, diff='diff.png', ref_out_dir=False, fuzz='5%', tol=0, height='87%',
off_y='0', sub=False):
off_y='0', sub=False, trim=False):
""" For images and single page PDFs """
if reference is None:
reference = image
@ -505,6 +505,9 @@ class TestContext(object):
png_image = image[:-3]+'png'
subprocess.check_call(['rsvg-convert', '-d', '300', '-p', '300', '-o', png_image, image])
image = png_image
if trim:
cmd = ['convert', image, '-trim', image]
subprocess.run(cmd)
cmd = ['compare',
# Tolerate 5 % error in color
'-fuzz', fuzz,