Skip to content

Commit 3d00574

Browse files
LukaszMrugalaaescolar
authored andcommitted
scripts: twister: New find_v2_boards() function
Current find_v2_boards() has a lot of unnecessarry fluff. We can make a new version of that function without it given its use in TestPlan.add_configurations(). Signed-off-by: Lukasz Mrugala <lukaszx.mrugala@intel.com>
1 parent a294a9a commit 3d00574

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

scripts/list_boards.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,17 @@ def load_v2_boards(board_name, board_yml, systems):
231231
return boards
232232

233233

234+
# Note that this does not share the args.board functionality of find_v2_boards
235+
def find_v2_board_dirs(args):
236+
dirs = []
237+
board_files = []
238+
for root in unique_paths(args.board_roots):
239+
board_files.extend((root / 'boards').rglob(BOARD_YML))
240+
241+
dirs = [board_yml.parent for board_yml in board_files if board_yml.is_file()]
242+
return dirs
243+
244+
234245
def find_v2_boards(args):
235246
root_args = argparse.Namespace(**{'soc_roots': args.soc_roots})
236247
systems = list_hardware.find_v2_systems(root_args)

scripts/pylib/twister/twisterlib/testplan.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,10 @@ def add_configurations(self):
407407
Path(ZEPHYR_BASE) / 'subsys' / 'testsuite'],
408408
board_roots=board_roots, board=None, board_dir=None)
409409
v1_boards = list_boards.find_boards(lb_args)
410-
v2_boards = list_boards.find_v2_boards(lb_args)
410+
v2_dirs = list_boards.find_v2_board_dirs(lb_args)
411411
for b in v1_boards:
412412
board_dirs.add(b.dir)
413-
for b in v2_boards:
414-
board_dirs.add(b.dir)
413+
board_dirs.update(v2_dirs)
415414
logger.debug("Reading platform configuration files under %s..." % self.env.board_roots)
416415

417416
platform_config = self.test_config.get('platforms', {})

0 commit comments

Comments
 (0)