Added KiBoM case to the makefile test.
This commit is contained in:
parent
f28b7a56b8
commit
4466277bde
|
|
@ -0,0 +1,110 @@
|
|||
[BOM_OPTIONS]
|
||||
; General BoM options here
|
||||
; If 'ignore_dnf' option is set to 1, rows that are not to be fitted on the PCB will not be written to the BoM file
|
||||
ignore_dnf = 1
|
||||
; If 'html_generate_dnf' option is set to 1, also generate a list of components not fitted on the PCB (HTML only)
|
||||
html_generate_dnf = 1
|
||||
; If 'use_alt' option is set to 1, grouped references will be printed in the alternate compressed style eg: R1-R7,R18
|
||||
use_alt = 0
|
||||
; If 'number_rows' option is set to 1, each row in the BoM will be prepended with an incrementing row number
|
||||
number_rows = 1
|
||||
; If 'group_connectors' option is set to 1, connectors with the same footprints will be grouped together, independent of the name of the connector
|
||||
group_connectors = 1
|
||||
; If 'test_regex' option is set to 1, each component group will be tested against a number of regular-expressions (specified, per column, below). If any matches are found, the row is ignored in the output file
|
||||
test_regex = 1
|
||||
; If 'merge_blank_fields' option is set to 1, component groups with blank fields will be merged into the most compatible group, where possible
|
||||
merge_blank_fields = 1
|
||||
; Specify output file name format, %O is the defined output name, %v is the version, %V is the variant name which will be ammended according to 'variant_file_name_format'.
|
||||
output_file_name = %O_bom_%v%V
|
||||
; Specify the variant file name format, this is a unique field as the variant is not always used/specified. When it is unused you will want to strip all of this.
|
||||
variant_file_name_format = _(%V)
|
||||
; Field name used to determine if a particular part is to be fitted
|
||||
fit_field = Config
|
||||
; Make a backup of the bom before generating the new one, using the following template
|
||||
make_backup = %O.tmp
|
||||
; Put the datasheet as a link for the following field
|
||||
datasheet_as_link =
|
||||
; Default number of boards to produce if none given on CLI with -n
|
||||
number_boards = 1
|
||||
; Default PCB variant if none given on CLI with -r
|
||||
board_variant = default
|
||||
; If 'hide_headers' option is set to 1, column headers aren't included in the output file
|
||||
hide_headers = 0
|
||||
; If 'hide_pcb_info' option is set to 1, PCB info isn't included in the output file
|
||||
hide_pcb_info = 0
|
||||
; Interpret as a Digikey P/N and link the following field
|
||||
digikey_link =
|
||||
|
||||
[IGNORE_COLUMNS]
|
||||
; Any column heading that appears here will be excluded from the Generated BoM
|
||||
; Titles are case-insensitive
|
||||
part lib
|
||||
footprint lib
|
||||
|
||||
[COLUMN_ORDER]
|
||||
; Columns will apear in the order they are listed here
|
||||
; Titles are case-insensitive
|
||||
Description
|
||||
Part
|
||||
Part Lib
|
||||
References
|
||||
Value
|
||||
Footprint
|
||||
Footprint Lib
|
||||
Quantity Per PCB
|
||||
Build Quantity
|
||||
Datasheet
|
||||
|
||||
[GROUP_FIELDS]
|
||||
; List of fields used for sorting individual components into groups
|
||||
; Components which match (comparing *all* fields) will be grouped together
|
||||
; Field names are case-insensitive
|
||||
Part
|
||||
Part Lib
|
||||
Value
|
||||
Footprint
|
||||
Footprint Lib
|
||||
|
||||
[COMPONENT_ALIASES]
|
||||
; A series of values which are considered to be equivalent for the part name
|
||||
; Each line represents a list of equivalent component name values separated by white space
|
||||
; e.g. 'c c_small cap' will ensure the equivalent capacitor symbols can be grouped together
|
||||
; Aliases are case-insensitive
|
||||
c c_small cap capacitor
|
||||
r r_small res resistor
|
||||
sw switch
|
||||
l l_small inductor
|
||||
zener zenersmall
|
||||
d diode d_small
|
||||
|
||||
[JOIN]
|
||||
; A list of rules to join the content of fields
|
||||
; Each line is a rule, the first name is the field that will receive the data
|
||||
; from the other fields
|
||||
; Use tab (ASCII 9) as separator
|
||||
; Field names are case sensitive
|
||||
|
||||
[REGEX_INCLUDE]
|
||||
; A series of regular expressions used to include parts in the BoM
|
||||
; If there are any regex defined here, only components that match against ANY of them will be included in the BOM
|
||||
; Column names are case-insensitive
|
||||
; Format is: "[ColumName] [Regex]" (white-space separated)
|
||||
|
||||
[COLUMN_RENAME]
|
||||
; A list of columns to be renamed
|
||||
; Format is: "[ColumName] [NewName]" (white-space separated)
|
||||
|
||||
[REGEX_EXCLUDE]
|
||||
; A series of regular expressions used to exclude parts from the BoM
|
||||
; If a component matches ANY of these, it will be excluded from the BoM
|
||||
; Column names are case-insensitive
|
||||
; Format is: "[ColumName] [Regex]" (white-space separated)
|
||||
References ^TP[0-9]*
|
||||
References ^FID
|
||||
Part mount.*hole
|
||||
Part solder.*bridge
|
||||
Part test.*point
|
||||
Footprint test.*point
|
||||
Footprint mount.*hole
|
||||
Footprint fiducial
|
||||
|
||||
|
|
@ -52,7 +52,7 @@ from kibot.gs import GS
|
|||
|
||||
|
||||
POS_DIR = 'positiondir'
|
||||
MK_TARGETS = ['position', 'archive', 'interactive_bom', 'run_erc', '3D']
|
||||
MK_TARGETS = ['position', 'archive', 'interactive_bom', 'run_erc', '3D', 'kibom_internal']
|
||||
cov = coverage.Coverage()
|
||||
|
||||
|
||||
|
|
@ -551,12 +551,14 @@ def test_no_colorama():
|
|||
ctx.search_err(r'\[31m.\[1mERROR:Testing 1 2 3')
|
||||
|
||||
|
||||
def check_test_v5_sch_deps(ctx, deps):
|
||||
assert len(deps) == 5, deps
|
||||
def check_test_v5_sch_deps(ctx, deps, extra=[]):
|
||||
assert len(deps) == 5+len(extra), deps
|
||||
dir = os.path.dirname(ctx.board_file)
|
||||
deps_abs = [os.path.abspath(f) for f in deps]
|
||||
for sch in ['test_v5.sch', 'sub-sheet.sch', 'deeper.sch', 'sub-sheet.sch', 'deeper.sch']:
|
||||
assert os.path.abspath(os.path.join(dir, sch)) in deps_abs
|
||||
for f in extra:
|
||||
assert f in deps
|
||||
|
||||
|
||||
def test_makefile_1():
|
||||
|
|
@ -574,6 +576,7 @@ def test_makefile_1():
|
|||
assert target in phony
|
||||
assert target in targets
|
||||
logging.debug('- Target `'+target+'` in all, .PHONY and itself OK')
|
||||
assert 'kibom_external' not in targets
|
||||
# position target
|
||||
deps = targets['position'].split(' ')
|
||||
assert len(deps) == 2, deps
|
||||
|
|
@ -601,22 +604,30 @@ def test_makefile_1():
|
|||
assert os.path.relpath(ctx.board_file) in deps
|
||||
# We can't check the WRL because it isn't included in the docker image
|
||||
logging.debug('- Target `3D` OK')
|
||||
# kibom_internal target
|
||||
deps = targets['kibom_internal'].split(' ')
|
||||
assert len(deps) == 1, deps
|
||||
assert ctx.get_out_path(os.path.join('BoM', prj+'-bom.html')) in deps
|
||||
check_test_v5_sch_deps(ctx, targets[targets['kibom_internal']].split(' '), [ctx.get_out_path('config.kibom.ini')])
|
||||
logging.debug('- Target `kibom_internal` OK')
|
||||
# archive target
|
||||
deps = targets['archive'].split(' ')
|
||||
assert len(deps) == 1, deps
|
||||
assert ctx.get_out_path(prj+'-archive.zip') in deps
|
||||
deps = targets[targets['archive']].split(' ')
|
||||
assert len(deps) == 9, deps
|
||||
assert len(deps) == 10, deps
|
||||
assert 'position' in deps
|
||||
assert 'interactive_bom' in deps
|
||||
assert '3D' in deps
|
||||
assert ctx.get_out_path('error.txt') in deps
|
||||
assert ctx.get_out_path('output.txt') in deps
|
||||
assert ctx.get_out_path('Makefile') in deps
|
||||
assert ctx.get_out_path('config.kibom.ini') in deps
|
||||
assert ctx.get_out_path('positiondir') in deps
|
||||
assert ctx.get_out_path('ibom') in deps
|
||||
assert ctx.get_out_path('3D') in deps
|
||||
logging.debug('- Target `archive` OK')
|
||||
ctx.search_err(r'\(kibom_external\) \[kibom\] uses a name generated by the external tool')
|
||||
ctx.clean_up()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -26,6 +26,23 @@ outputs:
|
|||
type: step
|
||||
dir: 3D
|
||||
|
||||
- name: 'kibom_internal'
|
||||
comment: 'BoM by KiBoM using internal config'
|
||||
type: kibom
|
||||
dir: BoM
|
||||
options:
|
||||
conf:
|
||||
hide_pcb_info: true
|
||||
|
||||
- name: 'kibom_external'
|
||||
comment: 'BoM by KiBoM using external config'
|
||||
type: kibom
|
||||
dir: BoM2
|
||||
options:
|
||||
conf: tests/data/bom.ini
|
||||
# Keep the KiBoM name
|
||||
output: ''
|
||||
|
||||
- name: 'archive'
|
||||
comment: 'Compressed files'
|
||||
type: compress
|
||||
|
|
|
|||
Loading…
Reference in New Issue