Added tests to cover missing lines in out_pdf_pcb_print.py

This commit is contained in:
Salvador E. Tropea 2021-02-01 15:51:04 -03:00
parent c67965c91b
commit f7826a7667
4 changed files with 50 additions and 3 deletions

View File

@ -46,7 +46,8 @@ from kibot.misc import (EXIT_BAD_ARGS, EXIT_BAD_CONFIG, NO_PCB_FILE, NO_SCH_FILE
POS_DIR = 'positiondir'
MK_TARGETS = ['position', 'archive', 'interactive_bom', 'run_erc', '3D', 'kibom_internal', 'drill', 'pcb_render']
MK_TARGETS = ['position', 'archive', 'interactive_bom', 'run_erc', '3D', 'kibom_internal', 'drill', 'pcb_render',
'print_front']
def test_skip_pre_and_outputs(test_dir):
@ -596,6 +597,12 @@ def test_makefile_1(test_dir):
assert ctx.get_out_path(prj+'-top$.svg') in deps
assert os.path.abspath(targets[targets['pcb_render']]) == ctx.board_file
logging.debug('- Target `pcb_render` OK')
# print_front target
deps = targets['print_front'].split(' ')
assert len(deps) == 1, deps
assert ctx.get_out_path(prj+'-F_Cu+F_SilkS.pdf') in deps
assert os.path.abspath(targets[targets['print_front']]) == ctx.board_file
logging.debug('- Target `print_front` OK')
# drill target
deps = targets['drill'].split(' ')
assert len(deps) == 3, deps

View File

@ -445,8 +445,15 @@ def test_error_gerber_precision(test_dir):
ctx.clean_up()
def test_error_wrong_drill_marks(test_dir):
ctx = context.TestContext(test_dir, 'WrongDrillMarks', PRJ, 'error_wrong_drill_marks', '')
def test_error_wrong_drill_marks_1(test_dir):
ctx = context.TestContext(test_dir, 'test_error_wrong_drill_marks_1', PRJ, 'error_wrong_drill_marks', '')
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("Unknown drill mark type: bogus")
ctx.clean_up()
def test_error_wrong_drill_marks_2(test_dir):
ctx = context.TestContext(test_dir, 'test_error_wrong_drill_marks_2', PRJ, 'error_wrong_drill_marks_2', '')
ctx.run(EXIT_BAD_CONFIG)
assert ctx.search_err("Unknown drill mark type: bogus")
ctx.clean_up()

View File

@ -0,0 +1,19 @@
# Example KiBot config file
kibot:
version: 1
outputs:
- name: 'print_front'
comment: "Print F.Cu+F.SilkS"
type: pdf_pcb_print
options:
scaling: 4
drill_marks: bogus
plot_sheet_reference: false
monochrome: true
separated: true
mirror: true
layers:
- layer: F.Cu
- layer: F.SilkS

View File

@ -59,6 +59,20 @@ outputs:
options:
output: '%f-%i$.%x'
- name: 'print_front'
comment: "Print F.Cu+F.SilkS"
type: pdf_pcb_print
options:
scaling: 4
drill_marks: none
plot_sheet_reference: false
monochrome: true
separated: true
mirror: true
layers:
- layer: F.Cu
- layer: F.SilkS
- name: 'archive'
comment: 'Compressed files'
type: compress