Skip to content

Commit 1fd41f1

Browse files
oharboeclaude
andcommitted
test: make issue archives the platform's scripts and the config files
The platform's Tcl, SDC and .cfg files are archived, and only those it has (The-OpenROAD-Project#2222). Of the design and platform directories only the config files are archived, every platform config*.mk among them (The-OpenROAD-Project#3870), unless FULL_ISSUE asks for the whole directories (The-OpenROAD-Project#1771). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
1 parent 573554c commit 1fd41f1

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

‎flow/test/test_make_issue.py‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,5 +488,44 @@ def test_preserve_paths(self):
488488
self.assertIn(f'export RESULTS_DIR="{work}/results_dir/', text)
489489

490490

491+
class TestPlatformAndDesignFiles(StubFlowTestCase):
492+
"""The platform's Tcl, SDC and .cfg files are archived, and only
493+
those it has (#2222); of the design and platform directories only the
494+
config files are, unless FULL_ISSUE asks for all of them (#1771),
495+
every platform config*.mk among them (#3870)."""
496+
497+
def names(self, **extra):
498+
archive = self.stub.make_issue(".", **extra)
499+
return [os.path.basename(m) for m in self.stub.members(archive)]
500+
501+
def test_platform_sdc_and_cfg(self):
502+
for name in ["constraints.sdc", "fill.cfg"]:
503+
self.stub.write(os.path.join(self.stub.platform_dir, name), "\n")
504+
names = self.names()
505+
for name in ["pdn.tcl", "constraints.sdc", "fill.cfg"]:
506+
self.assertIn(name, names)
507+
508+
def test_no_glob_for_files_the_platform_does_not_have(self):
509+
globs = makeIssue.platform_globs(self.stub.platform_dir)
510+
self.assertEqual(globs, [f"{self.stub.platform_dir}/*.tcl"])
511+
512+
def test_only_config_files_by_default(self):
513+
self.stub.write(os.path.join(self.stub.platform_dir, "config_extra.mk"), "\n")
514+
self.stub.write(os.path.join(self.stub.platform_dir, "cells.gds"), "\n")
515+
self.stub.write(os.path.join(self.stub.design_dir, "rtl.v"), "\n")
516+
names = self.names()
517+
self.assertIn("config.mk", names)
518+
self.assertIn("config_extra.mk", names)
519+
self.assertNotIn("cells.gds", names)
520+
self.assertNotIn("rtl.v", names)
521+
522+
def test_full_issue_archives_everything(self):
523+
self.stub.write(os.path.join(self.stub.platform_dir, "cells.gds"), "\n")
524+
self.stub.write(os.path.join(self.stub.design_dir, "rtl.v"), "\n")
525+
names = self.names(FULL_ISSUE="1")
526+
self.assertIn("cells.gds", names)
527+
self.assertIn("rtl.v", names)
528+
529+
491530
if __name__ == "__main__":
492531
unittest.main()

0 commit comments

Comments
 (0)