Merge main into feat/reduce-vias
This commit is contained in:
+16
-2
@@ -82,9 +82,23 @@ def test_cli_default_engine_is_exact(tmp_path):
|
||||
|
||||
|
||||
@pytest.mark.parametrize("engine", ["grid", "room"])
|
||||
def test_unchecked_engines_say_so(tmp_path, capsys, engine):
|
||||
def test_unchecked_engines_are_checked_after_routing(tmp_path, capsys, engine):
|
||||
assert main([str(FIXTURE), "--engine", engine, "-do", str(tmp_path / "out.ses")]) == 0
|
||||
assert "does not check its copper" in capsys.readouterr().err
|
||||
assert f"{engine} output checked on exact shapes: 0 short(s), 0 clearance" in capsys.readouterr().err
|
||||
|
||||
|
||||
def test_strict_fails_a_run_whose_copper_is_not_clean(tmp_path, monkeypatch, capsys):
|
||||
from rpmroute import cli
|
||||
from rpmroute.route.verify import VerifyReport, Violation
|
||||
|
||||
bad = VerifyReport(shorts=1, short_examples=[Violation("A", "B", "F.Cu", 1.0, 2.0)])
|
||||
monkeypatch.setattr(cli, "verify_result", lambda dsn, result: bad)
|
||||
out = tmp_path / "out.ses"
|
||||
assert main([str(FIXTURE), "--engine", "grid", "-do", str(out)]) == 0
|
||||
assert main([str(FIXTURE), "--engine", "grid", "--strict", "-do", str(out)]) == 3
|
||||
assert out.exists() # the session is still written
|
||||
err = capsys.readouterr().err
|
||||
assert "short: A x B on F.Cu at (1.00, 2.00) mm" in err and "not DRC-clean" in err
|
||||
|
||||
|
||||
def test_the_exact_engine_does_not_warn(tmp_path, capsys):
|
||||
|
||||
Reference in New Issue
Block a user