edtlib: test filters set by including bindings
Make sure filters set by property-allowlist and property-blocklist in an including binding are recursively applied to included bindings. Signed-off-by: Christophe Dufaza <chris@openmarl.org>
This commit is contained in:
parent
b3b5ad8156
commit
33bb3b60d9
|
@ -0,0 +1,3 @@
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
include: base.yaml
|
|
@ -0,0 +1,10 @@
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
description: Test property-allowlist filters set by including bindings
|
||||||
|
|
||||||
|
compatible: "top-allowlist"
|
||||||
|
|
||||||
|
include:
|
||||||
|
- name: inc-base.yaml
|
||||||
|
property-allowlist:
|
||||||
|
- x
|
|
@ -0,0 +1,10 @@
|
||||||
|
# SPDX-License-Identifier: BSD-3-Clause
|
||||||
|
|
||||||
|
description: Test property-blocklist filters set by including bindings.
|
||||||
|
|
||||||
|
compatible: "top-blocklist"
|
||||||
|
|
||||||
|
include:
|
||||||
|
- name: inc-base.yaml
|
||||||
|
property-blocklist:
|
||||||
|
- x
|
|
@ -378,6 +378,23 @@ def test_include_paths():
|
||||||
assert 'base.yaml' == os.path.basename(top.prop2specs["y"].path)
|
assert 'base.yaml' == os.path.basename(top.prop2specs["y"].path)
|
||||||
assert 'top.yaml' == os.path.basename(top.prop2specs["p"].path)
|
assert 'top.yaml' == os.path.basename(top.prop2specs["p"].path)
|
||||||
|
|
||||||
|
def test_include_filters_included_bindings():
|
||||||
|
'''Test filters set by including bindings.'''
|
||||||
|
fname2path = {'base.yaml': 'test-bindings-include/base.yaml',
|
||||||
|
'inc-base.yaml': 'test-bindings-include/inc-base.yaml'}
|
||||||
|
|
||||||
|
with from_here():
|
||||||
|
top_allows = edtlib.Binding('test-bindings-include/top-allows.yaml', fname2path)
|
||||||
|
assert top_allows.prop2specs.get("x")
|
||||||
|
assert not top_allows.prop2specs.get("y")
|
||||||
|
|
||||||
|
with from_here():
|
||||||
|
top_blocks = edtlib.Binding('test-bindings-include/top-blocks.yaml', fname2path)
|
||||||
|
assert not top_blocks.prop2specs.get("x")
|
||||||
|
assert top_blocks.prop2specs.get("y")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def test_bus():
|
def test_bus():
|
||||||
'''Test 'bus:' and 'on-bus:' in bindings'''
|
'''Test 'bus:' and 'on-bus:' in bindings'''
|
||||||
with from_here():
|
with from_here():
|
||||||
|
|
Loading…
Reference in New Issue