Tools: add test for duplicate labels in build_options.py

This commit is contained in:
Shiv Tyagi 2023-02-10 19:58:48 +05:30 committed by Peter Barker
parent 8892930adb
commit 5400aefd82
1 changed files with 10 additions and 0 deletions

View File

@ -313,8 +313,18 @@ class TestBuildOptions(object):
for feature in options:
self.get_disable_defines(feature, options)
def check_duplicate_labels(self):
'''check that we do not have multiple features with same labels'''
options = self.get_build_options_from_ardupilot_tree()
seen_labels = {}
for feature in options:
if seen_labels.get(feature.label, None) is not None:
raise ValueError("Duplicate entries found for label '%s'" % feature.label)
seen_labels[feature.label] = True
def run(self):
self.check_deps_consistency()
self.check_duplicate_labels()
if self.do_step_run_with_defaults:
self.progress("Running run-with-defaults step")
self.run_with_defaults()