-
Notifications
You must be signed in to change notification settings - Fork 8k
tests/samples: drivers: adc: rework tests filtering and configuration #94585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -280,6 +280,17 @@ def ast_expr(ast, env, edt): | |
if node and prop in node.props and node.props[prop].val: | ||
return True | ||
return False | ||
elif ast[0] == "dt_node_has_prop": | ||
# 1st arg 'label' must be a valid node alias or a node path | ||
label = ast[1][0] | ||
try: | ||
node = edt.get_node(label) | ||
Comment on lines
+284
to
+287
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why not name this variable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It can be an alias too, but I agree it's confusing, will recheck in a follow-up PR to document these expressions and address #94585 (comment) |
||
except Exception: | ||
return False | ||
prop = ast[1][1] | ||
if prop in node.props: | ||
return True | ||
return False | ||
|
||
|
||
mutex = threading.Lock() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be nice to rename
dt_node_prop_enabled
intodt_nodelabel_prop_enabled
to clarify that its 1st argument is a label. There's only 1 place where it's used (samples/boards/nxp/mimxrt1170_evk_cm7/magic_addr/sample.yaml).It would make your added
dt_node_has_prop
clearer that its 1st arg is a node path/alias.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a follow-up PR where I will document the different expressions as well.