Added tests to cover out_pdf_pcb_print.py, error case left out
This commit is contained in:
parent
2ade49bde5
commit
a48e9ecc96
|
|
@ -40,7 +40,9 @@ class PDF_Pcb_PrintOptions(BaseOptions):
|
|||
# Execute it
|
||||
logger.debug('Executing: '+str(cmd))
|
||||
ret = call(cmd)
|
||||
if ret:
|
||||
if ret: # pragma: no cover
|
||||
# We check all the arguments, we even load the PCB
|
||||
# A fail here isn't easy to reproduce
|
||||
logger.error(CMD_PCBNEW_PRINT_LAYERS+' returned %d', ret)
|
||||
exit(PDF_PCB_PRINT)
|
||||
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ if prev_dir not in sys.path:
|
|||
from utils import context
|
||||
|
||||
PDF_DIR = 'Layers'
|
||||
PDF_FILE = 'PCB_Top.pdf'
|
||||
PDF_FILE = 'bom.pdf'
|
||||
PDF_FILE_B = 'PCB_Bot.pdf'
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -421,3 +421,11 @@ def test_error_wrong_drill_marks():
|
|||
ctx.run(EXIT_BAD_CONFIG)
|
||||
assert ctx.search_err("Unknown drill mark type: bogus")
|
||||
ctx.clean_up()
|
||||
|
||||
|
||||
def test_error_print_pcb_no_layer():
|
||||
prj = 'bom'
|
||||
ctx = context.TestContext('PrPCB', prj, 'error_print_pcb_no_layer', '')
|
||||
ctx.run(EXIT_BAD_CONFIG)
|
||||
assert ctx.search_err("Missing .?layers.? list")
|
||||
ctx.clean_up()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,11 @@
|
|||
# Example KiPlot config file
|
||||
kiplot:
|
||||
version: 1
|
||||
|
||||
outputs:
|
||||
- name: 'print_front'
|
||||
comment: "Print F.Cu+F.SilkS"
|
||||
type: pdf_pcb_print
|
||||
dir: Layers
|
||||
options:
|
||||
output_name: PCB_Top.pdf
|
||||
|
|
@ -7,8 +7,6 @@ outputs:
|
|||
comment: "Print F.Cu+F.SilkS"
|
||||
type: pdf_pcb_print
|
||||
dir: Layers
|
||||
options:
|
||||
output_name: PCB_Top.pdf
|
||||
layers:
|
||||
- layer: F.Cu
|
||||
- layer: F.SilkS
|
||||
|
|
|
|||
Loading…
Reference in New Issue