From 82f5aa9a0b37bb9e467fa150935d3fa0fb3c9c78 Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Tue, 2 Feb 2021 10:36:19 -0300 Subject: [PATCH] Added makefile tests for schematic print (PDF and SVG) --- tests/test_plot/test_misc.py | 26 +++++++++++++++++++++++- tests/yaml_samples/makefile_1.kibot.yaml | 20 ++++++++++++++++++ 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/tests/test_plot/test_misc.py b/tests/test_plot/test_misc.py index 024f5b4e..7cf8d4b7 100644 --- a/tests/test_plot/test_misc.py +++ b/tests/test_plot/test_misc.py @@ -47,7 +47,7 @@ from kibot.misc import (EXIT_BAD_ARGS, EXIT_BAD_CONFIG, NO_PCB_FILE, NO_SCH_FILE POS_DIR = 'positiondir' MK_TARGETS = ['position', 'archive', 'interactive_bom', 'run_erc', '3D', 'kibom_internal', 'drill', 'pcb_render', - 'print_front'] + 'print_front', 'svg_sch_def', 'svg_sch_int', 'pdf_sch_def', 'pdf_sch_int'] def test_skip_pre_and_outputs(test_dir): @@ -614,6 +614,30 @@ def test_makefile_1(test_dir): assert ctx.get_out_path(os.path.join('gerbers', prj+'-drill_map.pdf')) in deps assert os.path.abspath(targets[targets['drill']]) == ctx.board_file logging.debug('- Target `drill` OK') + # svg_sch_def + deps = targets['svg_sch_def'].split(' ') + assert len(deps) == 1, deps + assert ctx.get_out_path(prj+'.svg') in deps + check_test_v5_sch_deps(ctx, targets[targets['svg_sch_def']].split(' ')) + logging.debug('- Target `svg_sch_def` OK') + # svg_sch_int + deps = targets['svg_sch_int'].split(' ') + assert len(deps) == 1, deps + assert ctx.get_out_path(prj+'-schematic.svg') in deps + check_test_v5_sch_deps(ctx, targets[targets['svg_sch_int']].split(' ')) + logging.debug('- Target `svg_sch_int` OK') + # pdf_sch_def + deps = targets['pdf_sch_def'].split(' ') + assert len(deps) == 1, deps + assert ctx.get_out_path(prj+'.pdf') in deps + check_test_v5_sch_deps(ctx, targets[targets['pdf_sch_def']].split(' ')) + logging.debug('- Target `pdf_sch_def` OK') + # pdf_sch_int + deps = targets['pdf_sch_int'].split(' ') + assert len(deps) == 1, deps + assert ctx.get_out_path(prj+'-schematic.pdf') in deps + check_test_v5_sch_deps(ctx, targets[targets['pdf_sch_int']].split(' ')) + logging.debug('- Target `pdf_sch_int` OK') # run_erc target deps = targets['run_erc'].split(' ') assert len(deps) == 1, deps diff --git a/tests/yaml_samples/makefile_1.kibot.yaml b/tests/yaml_samples/makefile_1.kibot.yaml index 3684d294..c74c966f 100644 --- a/tests/yaml_samples/makefile_1.kibot.yaml +++ b/tests/yaml_samples/makefile_1.kibot.yaml @@ -82,6 +82,26 @@ outputs: - layer: F.Cu - layer: F.SilkS + - name: 'svg_sch_def' + comment: "Print schematic, default name (SVG)" + type: svg_sch_print + options: + output: '' + + - name: 'svg_sch_int' + comment: "Print schematic, internal name (SVG)" + type: svg_sch_print + + - name: 'pdf_sch_def' + comment: "Print schematic, default name (PDF)" + type: pdf_sch_print + options: + output: '' + + - name: 'pdf_sch_int' + comment: "Print schematic, internal name (PDF)" + type: pdf_sch_print + - name: 'archive' comment: 'Compressed files' type: compress