Skip to content

Commit 15edce2

Browse files
hakehuangkartben
authored andcommitted
twister: add dt_node_prop_enabled support
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]>
1 parent 088afe9 commit 15edce2

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
sample:
2-
description: RT1170 FLEXRAM Magic Addr example
2+
description: RT11xx FLEXRAM Magic Addr example
33
name: magic addr
44
common:
55
integration_platforms:
@@ -8,6 +8,6 @@ common:
88
tags:
99
- pytest
1010
tests:
11-
sample.boards.mimxrt1170_evk.magic_addr:
12-
filter: CONFIG_MEMC_NXP_FLEXRAM
11+
sample.boards.magic_addr:
12+
filter: dt_node_prop_enabled("flexram", "flexram,has-magic-addr")
1313
harness: pytest

scripts/pylib/twister/expr_parser.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,14 @@ def ast_expr(ast, env, edt):
273273
if node and node.status == "okay":
274274
return True
275275
return False
276+
elif ast[0] == "dt_node_prop_enabled":
277+
label = ast[1][0]
278+
node = edt.label2node.get(label)
279+
prop = ast[1][1]
280+
if node and prop in node.props and node.props[prop].val:
281+
return True
282+
return False
283+
276284

277285
mutex = threading.Lock()
278286

0 commit comments

Comments
 (0)