Added test for run_drc to the makefile test.
- Also test the schematic fallback for preflight deps.
This commit is contained in:
parent
1ad91dbbd8
commit
370b5bdaf6
|
|
@ -47,7 +47,8 @@ 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', 'svg_sch_def', 'svg_sch_int', 'pdf_sch_def', 'pdf_sch_int', 'fake_sch', 'update_xml']
|
||||
'print_front', 'svg_sch_def', 'svg_sch_int', 'pdf_sch_def', 'pdf_sch_int', 'fake_sch', 'update_xml',
|
||||
'run_drc']
|
||||
|
||||
|
||||
def test_skip_pre_and_outputs(test_dir):
|
||||
|
|
@ -647,13 +648,19 @@ def test_makefile_1(test_dir):
|
|||
assert ctx.get_out_path(prj+'-erc.txt') in deps
|
||||
check_test_v5_sch_deps(ctx, targets[targets['run_erc']].split(' '))
|
||||
logging.debug('- Target `run_erc` OK')
|
||||
# run_drc target
|
||||
deps = targets['run_drc'].split(' ')
|
||||
assert len(deps) == 1, deps
|
||||
assert ctx.get_out_path(prj+'-drc.txt') in deps
|
||||
assert os.path.abspath(targets[targets['run_drc']]) == ctx.board_file
|
||||
logging.debug('- Target `run_drc` OK')
|
||||
# fake_sch target
|
||||
deps = targets['fake_sch'].split(' ')
|
||||
assert len(deps) == 6, deps
|
||||
check_test_v5_sch_deps(ctx, deps, extra=[ctx.get_out_path('n.lib'), ctx.get_out_path('y.lib'),
|
||||
ctx.get_out_path('sym-lib-table')], in_output=True)
|
||||
check_test_v5_sch_deps(ctx, targets[targets['fake_sch']].split(' '))
|
||||
logging.debug('- Target `run_erc` OK')
|
||||
logging.debug('- Target `fake_sch` OK')
|
||||
# 3D target
|
||||
deps = targets['3D'].split(' ')
|
||||
assert len(deps) == 1, deps
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ prev_dir = os.path.dirname(prev_dir)
|
|||
if prev_dir not in sys.path:
|
||||
sys.path.insert(0, prev_dir)
|
||||
from kibot.out_base import BaseOutput
|
||||
from kibot.pre_base import BasePreFlight
|
||||
from kibot.gs import GS
|
||||
from kibot.kiplot import load_actions, _import
|
||||
from kibot.registrable import RegOutput
|
||||
|
|
@ -115,8 +116,15 @@ class NoGetTargets(BaseOutput):
|
|||
self._sch_related = True
|
||||
|
||||
|
||||
class DummyPre(BasePreFlight):
|
||||
def __init__(self):
|
||||
super().__init__('dummy', True)
|
||||
self._sch_related = True
|
||||
|
||||
|
||||
def test_no_get_targets(caplog):
|
||||
test = NoGetTargets()
|
||||
test_pre = DummyPre()
|
||||
# Also check the dependencies fallback
|
||||
GS.sch = None
|
||||
GS.sch_file = 'fake'
|
||||
|
|
@ -125,11 +133,13 @@ def test_no_get_targets(caplog):
|
|||
cov.start()
|
||||
test.get_targets('')
|
||||
files = test.get_dependencies()
|
||||
files_pre = test_pre.get_dependencies()
|
||||
# Stop coverage
|
||||
cov.stop()
|
||||
cov.save()
|
||||
assert "Output 'Fake' (dummy) [none] doesn't implement get_targets(), plese report it" in caplog.text
|
||||
assert files == [GS.sch_file]
|
||||
assert files_pre == [GS.sch_file]
|
||||
|
||||
|
||||
def test_ibom_parse_fail(test_dir, caplog, monkeypatch):
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ kibot:
|
|||
|
||||
preflight:
|
||||
run_erc: true
|
||||
run_drc: true
|
||||
check_zone_fills: true
|
||||
update_xml: true
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue