twister: add dt_compat_enabled_with_label DT filter function
The function returns true if the node with the referenced node label is compatible and enabled. Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This commit is contained in:
parent
b92b580835
commit
bb4749709e
1 changed files with 7 additions and 0 deletions
|
@ -264,6 +264,13 @@ def ast_expr(ast, env, edt):
|
|||
|
||||
return ast_handle_dt_enabled_alias_with_parent_compat(edt, alias,
|
||||
compat)
|
||||
elif ast[0] == "dt_compat_enabled_with_label":
|
||||
compat = ast[1][0]
|
||||
label = ast[1][1]
|
||||
for node in edt.nodes:
|
||||
if node.status == "okay" and label in node.labels and node.matching_compat == compat:
|
||||
return True
|
||||
return False
|
||||
elif ast[0] == "dt_chosen_enabled":
|
||||
chosen = ast[1][0]
|
||||
node = edt.chosen_node(chosen)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue