from pathlib import Path import pytest from tools.target_registry import resolve_target,load_source_closure,TargetError from tools.fw_targets import load_source_closure as load_path_closure def test_both_closure_adapters_use_actual_current_sources(): for name in ('6400','mrdimm'): target=resolve_target(name) sources=load_source_closure(target) assert sources==load_path_closure(target.source_closure,target.project_id) assert ('src/actuator/mrdimm_actuator_core.v' in sources) == (name == 'mrdimm') assert Path(target.raw['top_file']).name == target.top_module + '.v' def test_retired_product_is_not_silently_reinterpreted(): with pytest.raises(TargetError):resolve_target('prod2u-door-temp')