test_multiproject_targets.py 815 B

12345678910111213141516
  1. from pathlib import Path
  2. import pytest
  3. from tools.target_registry import resolve_target,load_source_closure,TargetError
  4. from tools.fw_targets import load_source_closure as load_path_closure
  5. def test_both_closure_adapters_use_actual_current_sources():
  6. for name in ('6400','mrdimm'):
  7. target=resolve_target(name)
  8. sources=load_source_closure(target)
  9. assert sources==load_path_closure(target.source_closure,target.project_id)
  10. assert not any('/legacy/' in path or 'door_percent' in path for path in sources)
  11. assert ('src/motor/motor_engine.v' in sources)==(name=='mrdimm')
  12. assert Path(target.raw['top_file']).name==target.top_module+'.v'
  13. def test_retired_product_is_not_silently_reinterpreted():
  14. with pytest.raises(TargetError):resolve_target('prod2u-door-temp')