Added PS autoscale and --example -p without PCB tests.

This commit is contained in:
Salvador E. Tropea 2020-07-08 22:54:34 -03:00
parent 42342236da
commit 8f17733354
3 changed files with 62 additions and 0 deletions

View File

@ -21,6 +21,7 @@ Tests miscellaneous stuff.
- Create example
- with PCB
- already exists
- Copying
For debug information use:
pytest-3 --log-cli-level debug
@ -340,6 +341,7 @@ def test_help_preflights():
def test_example_1():
""" Example without board """
ctx = context.TestContext('Example1', '3Rs', 'pre_and_position', '')
ctx.run(extra=['--example'], no_verbose=True, no_yaml_file=True, no_board_file=True)
assert ctx.expect_out_file(EXAMPLE_CFG)
@ -347,6 +349,7 @@ def test_example_1():
def test_example_2():
""" Example with board """
ctx = context.TestContext('Example2', 'good-project', 'pre_and_position', '')
ctx.run(extra=['--example'], no_verbose=True, no_yaml_file=True)
assert ctx.expect_out_file(EXAMPLE_CFG)
@ -355,6 +358,7 @@ def test_example_2():
def test_example_3():
""" Overwrite error """
ctx = context.TestContext('Example3', 'good-project', 'pre_and_position', '')
ctx.run(extra=['--example'], no_verbose=True, no_yaml_file=True)
assert ctx.expect_out_file(EXAMPLE_CFG)
@ -363,6 +367,7 @@ def test_example_3():
def test_example_4():
""" Expand copied layers """
ctx = context.TestContext('Example4', 'good-project', 'pre_and_position', '')
ctx.run(extra=['--example', '-P'], no_verbose=True, no_yaml_file=True)
assert ctx.expect_out_file(EXAMPLE_CFG)
@ -372,8 +377,17 @@ def test_example_4():
def test_example_5():
""" Copy setting from PCB """
ctx = context.TestContext('Example5', 'good-project', 'pre_and_position', '')
ctx.run(extra=['--example', '-p'], no_verbose=True, no_yaml_file=True)
assert ctx.expect_out_file(EXAMPLE_CFG)
ctx.search_in_file(EXAMPLE_CFG, ['layers: selected', 'pen_width: 35.0'])
ctx.clean_up()
def test_example_6():
""" Copy setting but no PCB """
ctx = context.TestContext('Example6', 'good-project', 'pre_and_position', '')
ctx.run(EXIT_BAD_ARGS, extra=['--example', '-p'], no_verbose=True, no_yaml_file=True, no_board_file=True)
assert ctx.search_err('no PCB specified')
ctx.clean_up()

View File

@ -30,3 +30,17 @@ def test_ps():
ctx.dont_expect_out_file(ctx.get_gerber_job_filename())
ctx.clean_up()
def test_ps_auto():
prj = 'simple_2layer'
ctx = context.TestContext('Postscript', prj, 'ps_auto', PS_DIR)
ctx.run()
f_cu = ctx.get_gerber_filename('F_Cu', '.ps')
f_fab = ctx.get_gerber_filename('F_Fab', '.ps')
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()

View File

@ -0,0 +1,34 @@
kiplot:
version: 1
outputs:
- name: postscript
comment: "Postscript files"
type: ps
dir: PS
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
# PS options
line_width: 0.15
drill_marks: full
scaling: 0
sketch_plot: false
scale_adjust_x: 1.0
scale_adjust_y: 1.0
width_adjust: 0
mirror_plot: false
negative_plot: false
a4_output: true
layers:
- layer: F.Cu
suffix: F_Cu
- layer: F.Fab
suffix: F_Fab