Commit 3d00574d authored by Lukasz Mrugala's avatar Lukasz Mrugala Committed by Alberto Escolar
Browse files

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: default avatarLukasz Mrugala <lukaszx.mrugala@intel.com>
parent a294a9a9
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -231,6 +231,17 @@ def load_v2_boards(board_name, board_yml, systems):
    return boards


# Note that this does not share the args.board functionality of find_v2_boards
def find_v2_board_dirs(args):
    dirs = []
    board_files = []
    for root in unique_paths(args.board_roots):
        board_files.extend((root / 'boards').rglob(BOARD_YML))

    dirs = [board_yml.parent for board_yml in board_files if board_yml.is_file()]
    return dirs


def find_v2_boards(args):
    root_args = argparse.Namespace(**{'soc_roots': args.soc_roots})
    systems = list_hardware.find_v2_systems(root_args)
+2 −3
Original line number Diff line number Diff line
@@ -407,11 +407,10 @@ class TestPlan:
                            Path(ZEPHYR_BASE) / 'subsys' / 'testsuite'],
                            board_roots=board_roots, board=None, board_dir=None)
        v1_boards = list_boards.find_boards(lb_args)
        v2_boards = list_boards.find_v2_boards(lb_args)
        v2_dirs = list_boards.find_v2_board_dirs(lb_args)
        for b in v1_boards:
            board_dirs.add(b.dir)
        for b in v2_boards:
            board_dirs.add(b.dir)
        board_dirs.update(v2_dirs)
        logger.debug("Reading platform configuration files under %s..." % self.env.board_roots)

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