Skip to content

Commit 369c98b

Browse files
committed
test(generate_klayout_tech): expect abspath, not relpath
Earlier commit a1552a8 switched generate_klayout_tech.py to write absolute LEF paths into the LYT (bypasses klayout's relative-resolution escape to the bare-execroot under a Bazel sandbox). The unit test test_basic_generation still asserted the old relpath form and failed in CI: AssertionError: '../tech.lef' not found in '...<lef-files>/tmp/tmpwlgkq96a/tech.lef</lef-files>...' Update the assertion to expect os.path.abspath(lef_path). Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent f183165 commit 369c98b

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

flow/test/test_generate_klayout_tech.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,12 +130,13 @@ def test_basic_generation(self):
130130

131131
self.assertIn("<lef-files>", content)
132132
self.assertNotIn("original.lef", content)
133-
# Path should be relative to results_dir
134-
expected_rel = os.path.relpath(
135-
os.path.realpath(lef_path),
136-
os.path.realpath(self.results_dir),
137-
)
138-
self.assertIn(expected_rel, content)
133+
# LEF paths are written as plain abspath (not relpath, not realpath):
134+
# klayout's Layout.read resolves relative <lef-files> entries
135+
# against the realpath of the DEF being merged, which under a
136+
# Bazel sandbox is the bare execroot -- the in-flight sibling
137+
# files only exist in the per-action sandbox. Absolute paths
138+
# bypass the relative-resolution dance.
139+
self.assertIn(os.path.abspath(lef_path), content)
139140

140141
def test_with_map_files(self):
141142
with open(self.template, "w") as f:

0 commit comments

Comments
 (0)