From bb8d8a079a7673027c7de28cad091aeec467d913 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 20 May 2020 09:25:43 -0300 Subject: [PATCH] Added simple test for pdf_pcb_print --- tests/test_plot/test_print_pcb.py | 34 ++++++++++++++++++++++++ tests/yaml_samples/print_pcb.kiplot.yaml | 15 +++++++++++ 2 files changed, 49 insertions(+) create mode 100644 tests/test_plot/test_print_pcb.py create mode 100644 tests/yaml_samples/print_pcb.kiplot.yaml 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 +