twister: Add dt_nodelabel_enabled devicetree filter function
This function takes a node label (not a label property) and returns true if a node with such label exists and the node is enabled. Signed-off-by: Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
This commit is contained in:
parent
32da1078da
commit
cfaee96e92
1 changed files with 6 additions and 0 deletions
|
@ -279,6 +279,12 @@ def ast_expr(ast, env, edt):
|
||||||
if node and node.status == "okay":
|
if node and node.status == "okay":
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
elif ast[0] == "dt_nodelabel_enabled":
|
||||||
|
label = ast[1][0]
|
||||||
|
node = edt.label2node.get(label)
|
||||||
|
if node and node.status == "okay":
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
def ast_handle_dt_enabled_alias_with_parent_compat(edt, alias, compat):
|
def ast_handle_dt_enabled_alias_with_parent_compat(edt, alias, compat):
|
||||||
# Helper shared with the now deprecated
|
# Helper shared with the now deprecated
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue