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
|
return 1
|
||||||
|
|
||||||
def report_duplicates(self):
|
def report_duplicates(self):
|
||||||
all_tests = self.get_all_tests()
|
all_identifiers = []
|
||||||
|
for _, ts in self.testsuites.items():
|
||||||
dupes = [item for item, count in collections.Counter(all_tests).items() if count > 1]
|
all_identifiers.append(ts.id)
|
||||||
|
dupes = [item for item, count in collections.Counter(all_identifiers).items() if count > 1]
|
||||||
if dupes:
|
if dupes:
|
||||||
print("Tests with duplicate identifiers:")
|
print("Tests with duplicate identifiers:")
|
||||||
for dupe in dupes:
|
for dupe in dupes:
|
||||||
print("- {}".format(dupe))
|
print("- {}".format(dupe))
|
||||||
for dc in self.get_testsuite(dupe):
|
for dc in self.get_testsuite(dupe):
|
||||||
print(" - {}".format(dc))
|
print(" - {}".format(dc.name))
|
||||||
else:
|
else:
|
||||||
print("No duplicates found.")
|
print("No duplicates found.")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue