[Tests] Added KiKit tests

- stencil 3D, steel stencil and panel
- Bumped dependency to 1.3.0, needed for KiCad v7
  A patched version is needed ...
This commit is contained in:
Salvador E. Tropea 2023-03-03 10:53:23 -03:00
parent d656b338b2
commit e27753a8d6
12 changed files with 120 additions and 7 deletions

View File

@ -143,7 +143,7 @@ Notes:
- Show KiAuto installation information for `info` (v2.0.0)
- Print the page frame in GUI mode for `pcb_print` (v1.6.7)
[**KiKit**](https://github.com/yaqwsx/KiKit) [![Tool](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/llave-inglesa-22x22.png)](https://github.com/yaqwsx/KiKit) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png)
[**KiKit**](https://github.com/yaqwsx/KiKit) v1.3.0 [![Tool](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/llave-inglesa-22x22.png)](https://github.com/yaqwsx/KiKit) ![Auto-download](https://raw.githubusercontent.com/INTI-CMNB/KiBot/master/docs/images/auto_download-22x22.png)
- Mandatory for: `panelize`, `stencil_3d`, `stencil_for_jig`
- Optional to separate multiboard projects for general use

View File

@ -73,6 +73,7 @@ Dependencies:
github: yaqwsx/KiKit
pypi: KiKit
downloader: pytool
version: 1.3.0
- from: KiKit
role: Separate multiboard projects
- name: Xvfbwrapper

View File

@ -716,28 +716,44 @@ deps = '{\
"mandatory": false,\
"max_version": null,\
"output": "global",\
"version": null\
"version": [\
1,\
3,\
0\
]\
},\
{\
"desc": null,\
"mandatory": true,\
"max_version": null,\
"output": "panelize",\
"version": null\
"version": [\
1,\
3,\
0\
]\
},\
{\
"desc": null,\
"mandatory": true,\
"max_version": null,\
"output": "stencil_3d",\
"version": null\
"version": [\
1,\
3,\
0\
]\
},\
{\
"desc": null,\
"mandatory": true,\
"max_version": null,\
"output": "stencil_for_jig",\
"version": null\
"version": [\
1,\
3,\
0\
]\
}\
],\
"tests": [],\

Binary file not shown.

After

Width:  |  Height:  |  Size: 785 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 852 KiB

View File

@ -0,0 +1 @@
../6_0_8/light_control-stencil_3d_top.png

View File

@ -0,0 +1 @@
../6_0_8/light_control-stencil_for_jig_top.png

View File

@ -1595,3 +1595,34 @@ def test_lcsc_field_specified(test_dir):
assert ctx.search_err('User selected.*Cryptic')
r, _, _ = ctx.load_csv(prj+'_bom_jlc.csv')
assert r[0][3] == 'C1234'
@pytest.mark.skipif(context.ki5(), reason="KiKit is v6+")
def test_stencil_3D_1(test_dir):
prj = 'light_control'
ctx = context.TestContext(test_dir, prj, 'stencil_3D_1', 'stencil/3D')
ctx.run(extra=[])
ctx.expect_out_file_d(prj+'-stencil_3d_top.stl')
ctx.compare_image(prj+'-stencil_3d_top.png', sub=True, tol=100)
ctx.clean_up(keep_project=True)
@pytest.mark.slow
@pytest.mark.skipif(context.ki5(), reason="KiKit is v6+")
def test_stencil_steel_1(test_dir):
prj = 'light_control'
ctx = context.TestContext(test_dir, prj, 'stencil_for_jig_1', 'stencil/Jig')
ctx.run(extra=[])
ctx.expect_out_file_d(prj+'-stencil_for_jig_top.stl')
ctx.compare_image(prj+'-stencil_for_jig_top.png', sub=True, tol=100)
ctx.clean_up(keep_project=True)
@pytest.mark.slow
@pytest.mark.skipif(context.ki5(), reason="KiKit is v6+")
def test_panelize_1(test_dir):
prj = 'light_control'
ctx = context.TestContext(test_dir, prj, 'panelize_2')
ctx.run(extra=[])
ctx.compare_image(prj+'-panel.png')
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'):
off_y='0', sub=False):
""" For images and single page PDFs """
if reference is None:
reference = image
@ -494,7 +494,7 @@ class TestContext(object):
reference = self.get_out_path(reference)
else:
reference = os.path.join(REF_DIR, reference)
image = self.get_out_path(image)
image = self.get_out_path(image, sub)
png_ref = None
if reference[-3:] == 'svg':
png_ref = reference[:-3]+'png'

View File

@ -0,0 +1,63 @@
# Example KiBot config file for a basic panel
kibot:
version: 1
outputs:
- name: 'panel'
comment: "Create a 4x4 complex panel"
type: panelize
options:
title: '+ (Panel)'
units: mm
create_preview: true
configs:
- layout:
rows: 2
cols: 2
space: 2
hbackbone: 5
vbackbone: 5
hboneskip: 1
vboneskip: 1
page:
size: A3
tabs:
type: fixed
width: 3
vcount: 2
hcount: 0
cuts:
type: mousebites
drill: 0.5
spacing: 1mm
offset: 0.2
prolong: 0.5
framing:
type: railstb
width: 5
space: 3
copperfill:
type: hatched
clearance: 2
spacing: 0.5
width: 0.5
tooling:
type: 3hole
hoffset: 2.5
voffset: 2.5
size: 1.5
fiducials:
type: 3fid
hoffset: 5
voffset: 2.5
coppersize: 2
opening: 1
text:
type: simple
text: My panel
anchor: mt
voffset: 2.5
hjustify: center
vjustify: center
post:
millradius: 1