Files
retroSoC/tests/test_repository_layout.py
T
maksyuki 5d61b7e90a refactor: refactor RTL paths and update test descriptions
- Updated RTL paths in various files to remove the 'ribp' prefix, reflecting the new directory structure.
- Modified test descriptions to remove version indicators (e.g., V2, V3) for clarity and consistency.
- Adjusted file references in scripts and tests to align with the new peripheral and multimedia directory structure.
- Added a new test to ensure repository layout invariants, confirming the absence of deprecated paths.
2026-08-13 13:41:52 +08:00

33 lines
1.3 KiB
Python

"""Repository layout invariants for self-owned IP and dependency inputs."""
from pathlib import Path
ROOT = Path(__file__).resolve().parents[1]
def test_self_owned_ip_is_flattened_and_dependency_lock_is_distinct() -> None:
assert not (ROOT / "rtl/ip/ribp").exists()
assert (ROOT / "rtl/ip/peripheral").is_dir()
assert (ROOT / "rtl/ip/serial").is_dir()
assert not (ROOT / "config").exists()
assert (ROOT / "dependencies/dependencies.lock.json").is_file()
assert (ROOT / "configs/ci/ihp130.mk").is_file()
def test_active_sources_do_not_reference_removed_paths() -> None:
roots = (ROOT / "rtl/mini", ROOT / "scripts", ROOT / "tests", ROOT / "docs")
removed_ip_path = "rtl/ip/" + "ribp"
removed_filelist_path = "/ip/" + "ribp"
removed_lock_path = "config/" + "dependencies.lock.json"
for search_root in roots:
for path in search_root.rglob("*"):
if path == Path(__file__):
continue
if not path.is_file() or path.suffix not in {".fl", ".mk", ".json", ".md", ".py"}:
continue
text = path.read_text(encoding="utf-8")
assert removed_ip_path not in text
assert removed_filelist_path not in text
assert removed_lock_path not in text