zephyr/scripts/dts/python-devicetree/tests/test-bindings-init/base.yaml
Christophe Dufaza ee5c520326 edtlib: tests: refine coverage of Binding objects initialization
Add a series of unit tests which try to cover somewhat systematically
the possible inputs and what we finally get at the exit
of the Binding constructor.

Running the assumption that any (valid) YAML binding file is
something we can make a Binding instance with:
- check which properties are defined at which level (binding,
  child-binding, grandchild-binding, etc) and their specifications
  once the binding is initialized
- check how including bindings are permitted to specialize
  the specifications of inherited properties
- check the rules applied when overwriting a binding's description
  or compatible string (at the binding, child-binding, etc, levels)

Some tests covering known issues are disabled by default:
- this permits to document these issues
- while not causing CI errors (when running the python-devicetree
  unit tests)
- enabling these tests without causing errors should allow us
  to consider the related issues are fixed

Signed-off-by: Christophe Dufaza <chris@openmarl.org>
2025-01-08 19:17:51 +01:00

104 lines
2.1 KiB
YAML

# SPDX-License-Identifier: BSD-3-Clause
#
# Base include file for testing bindings initialization.
#
# Involves base property definitions ("type:", "description:", "const:",
# "required:", "enum:" and "default:") up to the grandchild-binding level.
#
# Binding:
# + prop-1
# + prop-2
# + prop-enum
# + prop-req
# + prop-const
# + prop-default
#
# Child-binding:
# + child-prop-1
# + child-prop-2
# + child-prop-enum
# + child-prop-req
# + child-prop-const
# + child-prop-default
#
# Grandchild-binding:
# + grandchild-prop-1
# + grandchild-prop-2
# + grandchild-prop-enum
# + grandchild-prop-req
# + grandchild-prop-const
# + grandchild-prop-default
description: Base property specifications.
properties:
prop-1:
description: Base property 1.
type: int
prop-2:
type: string
prop-enum:
type: string
required: false
enum:
- FOO
- BAR
prop-const:
type: int
const: 8
prop-req:
type: int
required: true
prop-default:
type: int
default: 1
child-binding:
description: Base child-binding description.
properties:
child-prop-1:
description: Base child-prop 1.
type: int
child-prop-2:
type: string
child-prop-enum:
type: string
required: false
enum:
- CHILD_FOO
- CHILD_BAR
child-prop-const:
type: int
const: 16
child-prop-req:
type: int
required: true
child-prop-default:
type: int
default: 2
child-binding:
description: Base grandchild-binding description.
properties:
grandchild-prop-1:
description: Base grandchild-prop 1.
type: int
grandchild-prop-2:
type: string
grandchild-prop-enum:
type: string
required: false
enum:
- GRANDCHILD_FOO
- GRANDCHILD_BAR
grandchild-prop-const:
type: int
const: 32
grandchild-prop-req:
type: int
required: true
grandchild-prop-default:
type: int
default: 3