Added simple test for pdf_pcb_print

This commit is contained in:
Salvador E. Tropea 2020-05-20 09:25:43 -03:00
parent da94eb3f57
commit bb8d8a079a
2 changed files with 49 additions and 0 deletions

View File

@ -0,0 +1,34 @@
"""
Tests of Printing PCB files
We test:
- PDF for bom.kicad_pcb
For debug information use:
pytest-3 --log-cli-level debug
"""
import os
import sys
# Look for the 'utils' module from where the script is running
script_dir = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, os.path.dirname(script_dir))
# Utils import
from utils import context
PDF_DIR = 'Layers'
PDF_FILE = 'PCB_Top.pdf'
def test_print_sch():
prj = 'bom'
ctx = context.TestContext('PrPCB', prj, 'print_pcb', PDF_DIR)
ctx.run()
# Check all outputs are there
ctx.expect_out_file(os.path.join(PDF_DIR, PDF_FILE))
# We don't have a project, and we don't want one
os.remove(os.path.join(ctx.get_board_dir(), prj+'.pro'))
# We don't have a footprint cache, and we don't want one
os.remove(os.path.join(ctx.get_board_dir(), 'fp-info-cache'))
ctx.clean_up()

View File

@ -0,0 +1,15 @@
# 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
layers:
- layer: F.Cu
- layer: F.SilkS