Skip to content

Commit

Permalink
twister: add dt_node_prop_enabled support
Browse files Browse the repository at this point in the history
using "dt_node_prop_enabled" to filter out supported platforms
1. check node existing.
2. check prop in node.
3. check the prop is True.

Signed-off-by: Hake Huang <[email protected]>
  • Loading branch information
hakehuang committed Dec 16, 2024
1 parent 29208fe commit 41cbb5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ common:
- pytest
tests:
sample.boards.mimxrt1170_evk.magic_addr:
filter: CONFIG_MEMC_NXP_FLEXRAM
filter: CONFIG_MEMC_NXP_FLEXRAM and dt_node_prop_enabled("flexram", "flexram,has-magic-addr")
harness: pytest
8 changes: 8 additions & 0 deletions scripts/pylib/twister/expr_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,14 @@ def ast_expr(ast, env, edt):
if node and node.status == "okay":
return True
return False
elif ast[0] == "dt_node_prop_enabled":
label = ast[1][0]
node = edt.label2node.get(label)
prop = ast[1][1]
if node and prop in node.props and node.props[prop].val:
return True
return False


mutex = threading.Lock()

Expand Down

0 comments on commit 41cbb5e

Please sign in to comment.