twister: show duplicates correctly
Find duplicate test identifiers and report them with --list-test-duplicates. Signed-off-by: Anas Nashif <anas.nashif@intel.com>
This commit is contained in:
parent
fa57cd613b
commit
ae24329daa
1 changed files with 5 additions and 4 deletions
|
@ -249,15 +249,16 @@ class TestPlan:
|
|||
return 1
|
||||
|
||||
def report_duplicates(self):
|
||||
all_tests = self.get_all_tests()
|
||||
|
||||
dupes = [item for item, count in collections.Counter(all_tests).items() if count > 1]
|
||||
all_identifiers = []
|
||||
for _, ts in self.testsuites.items():
|
||||
all_identifiers.append(ts.id)
|
||||
dupes = [item for item, count in collections.Counter(all_identifiers).items() if count > 1]
|
||||
if dupes:
|
||||
print("Tests with duplicate identifiers:")
|
||||
for dupe in dupes:
|
||||
print("- {}".format(dupe))
|
||||
for dc in self.get_testsuite(dupe):
|
||||
print(" - {}".format(dc))
|
||||
print(" - {}".format(dc.name))
|
||||
else:
|
||||
print("No duplicates found.")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue