-
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 paths of properties from included child-bindings
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 can use the same approach we've already come to for property specifications: - zephyrproject-rtos/zephyr#65135 - zephyrproject-rtos/zephyr#65221
- Loading branch information
Showing
11 changed files
with
672 additions
and
19 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,71 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: | | ||
Extends edtlib's upstream allow-and-blocklist-multilevel.yaml test case, adds: | ||
- check of bindings and property specs paths | ||
- check of grand-grandchild-binding level | ||
- check grandchild-binding filters | ||
- check setting "required: true" won't truncate included | ||
child-binding's property definitions | ||
All child-binding definitions come from a single file, | ||
included multiple times, at different levels, | ||
with different filters. | ||
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: | ||
child-prop-1: | ||
required: true | ||
z: | ||
required: true | ||
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,30 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: | | ||
Base include file for the allow-and-blocklist-anylevel.yaml test case. | ||
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: Apache-2.0 | ||
|
||
description: | | ||
Left include file for left_rigt.yaml. | ||
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,35 @@ | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
description: | | ||
Complements allow-and-blocklist-anylevel.yaml test case, | ||
here child-binding definitions come from two files. | ||
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-prop-1: | ||
required: true | ||
left-right-prop: | ||
type: int | ||
|
||
child-binding: | ||
properties: | ||
left-child-prop-1: | ||
required: true | ||
child-prop: | ||
type: int | ||
child-binding: | ||
properties: | ||
grandchild-prop: | ||
type: int |
Oops, something went wrong.