Skip to content

Commit 0931357

Browse files
committed
fix: Fix broken tp/cg filtering/update in testplan.py
I accidentally removed the filtering with f328cbc. Then (worse!) removed the update to the class variable in 78c0fab. This commit puts both back, and also now distinguishes between "there are no testpoints" and "you have filtered out all of the testpoints". Signed-off-by: Rupert Swarbrick <rswarbrick@lowrisc.org>
1 parent c6ec8bb commit 0931357

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

src/dvsim/testplan.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,19 @@ def _parse_testplan(self, filename: Path, tags: set[str], repo_top: Path) -> Non
561561
Testplan._check_duplicates("testpoint", all_tps)
562562
Testplan._check_duplicates("covergroup", all_cgs)
563563

564+
# The testplan might have been filtered with a set of tags. Apply that
565+
# filter, then check that we haven't discarded everything.
566+
self.testpoints = [t for t in all_tps if t.has_tags(tags)]
567+
self.covergroups = [cg for cg in all_cgs if cg.has_tags(tags)]
568+
569+
if not (self.testpoints or self.covergroups):
570+
msg = (
571+
f"Merged testplan has no testpoints or covergroups, after "
572+
f"filtering with tags {tags}. Before filtering, the numbers of "
573+
f"testpoints and covergroups were {len(all_tps)}, {len(all_cgs)}."
574+
)
575+
raise ValueError(msg)
576+
564577
# Wildcards in testpoints can mostly point to any value from the
565578
# object. The following names are *not* allowed (because they wouldn't
566579
# really make much sense).

0 commit comments

Comments
 (0)