From e119732fb3185be08778c1631288a020690cffaf Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Mon, 25 May 2020 18:39:12 -0300 Subject: [PATCH] Added simple SVG test --- tests/test_plot/test_svg.py | 31 ++++++++++++++++++++++++++++++ tests/yaml_samples/svg.kiplot.yaml | 30 +++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 tests/test_plot/test_svg.py create mode 100644 tests/yaml_samples/svg.kiplot.yaml diff --git a/tests/test_plot/test_svg.py b/tests/test_plot/test_svg.py new file mode 100644 index 00000000..9c62b924 --- /dev/null +++ b/tests/test_plot/test_svg.py @@ -0,0 +1,31 @@ +""" +Tests of SVG format. + +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 + + +PS_DIR = 'SVG' + + +def test_svg(): + prj = 'simple_2layer' + ctx = context.TestContext('SVG', prj, 'svg', PS_DIR) + ctx.run() + + f_cu = ctx.get_gerber_filename('F_Cu', '.svg') + f_fab = ctx.get_gerber_filename('F_Fab', '.svg') + ctx.expect_out_file(f_cu) + ctx.expect_out_file(f_fab) + ctx.dont_expect_out_file(ctx.get_gerber_job_filename()) + + ctx.clean_up() diff --git a/tests/yaml_samples/svg.kiplot.yaml b/tests/yaml_samples/svg.kiplot.yaml new file mode 100644 index 00000000..acf174b0 --- /dev/null +++ b/tests/yaml_samples/svg.kiplot.yaml @@ -0,0 +1,30 @@ +kiplot: + version: 1 + +outputs: + - name: SVG + comment: "SVG files" + type: svg + dir: SVG + options: + exclude_edge_layer: false + exclude_pads_from_silkscreen: false + use_aux_axis_as_origin: false + plot_sheet_reference: false + plot_footprint_refs: true + plot_footprint_values: true + force_plot_invisible_refs_vals: false + tent_vias: true + check_zone_fills: true + + # SVG options + line_width: 0.25 + drill_marks: full + mirror_plot: true + negative_plot: true + layers: + - layer: F.Cu + suffix: F_Cu + - layer: F.Fab + suffix: F_Fab +