Functions and scripts for performing automated testing on a KiCad project

ERC and DRC tests

ERC and DRC test are performed using KiBot. These tests can be configured by editing the erc.yaml and drc.yaml files in the .kicad_helpers_config directory. For example, ERC warnings are treated as errors by default, but this behavior can be changed by replacing the following line in .kicad_helpers_config/erc.yaml:

erc_warnings: true

with

erc_warnings: false

You can also filter out specific errors/warnings using filters. Refer to the KiBot documentation for details.

test_erc[source]

test_erc(root='.')

test_erc(root)

test_drc[source]

test_drc(root='.')

test_drc(root)

BOM validation

validate_bom[source]

validate_bom(root='.')

validate_bom(root)
Refs Quantity MPN Manufacturer datasheet footprint value
0 C1, C3, C5, C6, C8-C13, C16 11 CL21B104KBCNNNC Samsung NaN Capacitors_SMD:C_0805 0.1uF
1 C14, C15 2 CL21C151JBANNNC Samsung NaN Capacitors_SMD:C_0805 150pF
2 C2, C4 2 T491D336K020AT KEMET NaN Sci-Bots:SM2917 33uF
3 C7 1 CL21B103KCANNNC Samsung NaN Capacitors_SMD:C_0805 0.01uF
4 DS1 1 150080BS75000 Würth Elektronik NaN LEDs:LED_0805 +3.3V_PWR
5 FB1-FB5 5 742792040 Würth Elektronik NaN Resistors_SMD:R_0805 FERRITE
6 JP1 1 DNP DNP NaN Resistors_SMD:R_0805 JUMPER
7 P1 1 DNP DNP NaN Pin_Headers:Pin_Header_Angled_1x06 CONN_01X06
8 P2 1 DNP DNP NaN Pin_Headers:Pin_Header_Straight_2x03 CONN_01X06
9 P3-P6 4 DNP DNP NaN Connect:1pin CONN_01X01
10 P7 1 TFM-125-02-L-DH Samtec NaN Sci-Bots:TFM-125-02-X-DH TFM-125-02-X-DH
11 R99, R100 2 RC0805FR-0751RL Yageo NaN Resistors_SMD:R_0805 51
12 R125, R126 2 RC0805FR-07150RL Yageo NaN Resistors_SMD:R_0805 150
13 R43 1 RC0805FR-0710KL Yageo NaN Resistors_SMD:R_0805 10k
14 R45 1 RC0805FR-071KL Yageo NaN Resistors_SMD:R_0805 1k
15 U1-U5 5 MM74HC595MX onsemi ~ Sci-Bots:SO16E 74HC595A
16 U6 1 W25Q64FVSSIG TR Winbond NaN SMD_Packages:SOIC-8-N W25Q64FV
17 U7 1 ATMEGA328P-AU Microchip NaN Housings_QFP:TQFP-32_7x7mm_Pitch0.8mm ATMEGA328P-AU
18 Y1 1 CSTCE8M00G55-R0 Murata http://www.murata.com/~/media/webrenewal/suppo... Sci-Bots:CSTCE_G15C RESONATOR
19 CH0-CH39 40 AQW214EAZ Panasonic NaN SMD_Packages:DIP-8_SMD AQW214
20 R1, R6, R7, R12, R13, R18, R19, R24, R25, R30,... 40 RC0805FR-074K75L Yageo NaN Resistors_SMD:R_0805 4.75k
21 R2-R5, R8-R11, R14-R17, R20-R23, R26-R29, R32-... 80 RC0805FR-07220RL Yageo NaN Resistors_SMD:R_0805 220

Test notebooks

test_notebooks[source]

test_notebooks(fname:"A notebook name or glob to convert"=None, flags:"Space separated list of flags"=None, n_workers:"Number of workers to use"=None, verbose:"Print errors along the way"=True, timing:"Timing each notebook to see the ones are slow"=False, pause:"Pause time (in secs) between notebooks to avoid race conditions"=0.5, root:"project root directory"='.')

Test all notebooks matching fname in parallel, passing along flags

Run all tests in the tests directory.

> kh_test
testing /home/ryan/dev/python/kicad-helpers/_temp/tests/Tests.ipynb
All tests are passing!