diff --git a/tests/test_plot/test_print_pcb.py b/tests/test_plot/test_print_pcb.py new file mode 100644 index 00000000..ea16f99f --- /dev/null +++ b/tests/test_plot/test_print_pcb.py @@ -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() diff --git a/tests/yaml_samples/print_pcb.kiplot.yaml b/tests/yaml_samples/print_pcb.kiplot.yaml new file mode 100644 index 00000000..5821712e --- /dev/null +++ b/tests/yaml_samples/print_pcb.kiplot.yaml @@ -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 +