-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
edtlib: preserve the origin of child-bindings definitions
All child bindings are initialized at once after included binding files have been merged, with the top-level binding file set as their origin. As a consequence, properties of child bindings appear to all come from ("last modified" semantic) the top-level file. For example, properties of a channel child of an ADC controller with compatible "nordic,nrf-saadc" will all appear last modified by nordic,nrf-saadc.yaml instead of adc-controller.yaml. We should use the same approach we've already come to for property specifications: - #5 - zephyrproject-rtos/zephyr#65221
- Loading branch information
Showing
9 changed files
with
541 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
description: | | ||
Extends edtlib's upstream allow-and-blocklist-multilevel.yaml test case. | ||
compatible: vnd,allow-and-blocklist-anylevel | ||
|
||
# child-binding: | ||
# + child-prop-1 | ||
# | ||
# grandchild-binding: | ||
# + gandchild-prop-1 | ||
# + gandchild-prop-2 | ||
include: | ||
- name: base.yaml | ||
property-allowlist: [x] | ||
|
||
child-binding: | ||
property-allowlist: [child-prop-1] | ||
|
||
child-binding: | ||
property-blocklist: [grandchild-prop-blocked] | ||
|
||
properties: | ||
ceil-prop: | ||
type: int | ||
|
||
child-binding: | ||
include: | ||
# child-binding: | ||
# ~ child-prop-1 | ||
# + x | ||
# + z | ||
- name: base.yaml | ||
property-blocklist: [y] | ||
|
||
# grandchild-binding: | ||
# ~ gandchild-prop-1 | ||
# ~ gandchild-prop-2 | ||
# + child-prop-1 | ||
# + child-prop-1 | ||
child-binding: | ||
property-blocklist: [child-prop-blocked] | ||
|
||
# grandgrandchild-binding: | ||
# + gandchild-prop-1 | ||
# + gandchild-prop-2 | ||
child-binding: | ||
property-blocklist: [grandchild-prop-blocked] | ||
|
||
properties: | ||
cb-prop: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
gcbb-prop: | ||
type: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
description: | | ||
Includes can be added at any level, so can property-allowlist and | ||
property-blocklist. | ||
compatible: allow-and-blocklist-multilevel | ||
|
||
include: | ||
- name: include.yaml | ||
property-allowlist: [x] | ||
|
||
child-binding: | ||
include: | ||
- name: include.yaml | ||
property-blocklist: [y] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
description: | | ||
Extends edtlib's upstream include.yaml with an additional property | ||
for testing nested "child-binding:" filters. | ||
See allow-and-blocklist-anylevel.yaml. | ||
properties: | ||
x: | ||
type: int | ||
y: | ||
type: int | ||
z: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
child-prop-1: | ||
type: int | ||
child-prop-2: | ||
type: int | ||
child-prop-blocked: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
grandchild-prop-1: | ||
type: int | ||
grandchild-prop-2: | ||
type: int | ||
grandchild-prop-blocked: | ||
type: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
description: Test file for including other bindings | ||
compatible: include | ||
properties: | ||
x: | ||
type: int | ||
y: | ||
type: int | ||
z: | ||
type: int | ||
child-binding: | ||
properties: | ||
child-prop-1: | ||
type: int | ||
child-prop-2: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
grandchild-prop-1: | ||
type: int | ||
grandchild-prop-2: | ||
type: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
description: | | ||
Left include file for the multi-includes test case. | ||
properties: | ||
left-prop-1: | ||
type: int | ||
left-prop-2: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
left-child-prop-1: | ||
type: int | ||
left-child-prop-2: | ||
type: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
description: | | ||
Test multi-includes from top-level binding. | ||
compatible: vnd,left_right | ||
|
||
include: | ||
- name: left.yaml | ||
property-allowlist: [left-prop-1] | ||
child-binding: | ||
property-allowlist: [left-child-prop-1] | ||
|
||
- name: right.yaml | ||
property-allowlist: [right-prop-2] | ||
child-binding: | ||
property-allowlist: [right-child-prop-2] | ||
|
||
properties: | ||
left-right-prop: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
child-prop: | ||
type: int | ||
child-binding: | ||
properties: | ||
grandchild-prop: | ||
type: int |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# SPDX-License-Identifier: BSD-3-Clause | ||
|
||
description: | | ||
Right include file for the multi-includes test case. | ||
properties: | ||
right-prop-1: | ||
type: int | ||
right-prop-2: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
right-child-prop-1: | ||
type: int | ||
right-child-prop-2: | ||
type: int |
Oops, something went wrong.