Re: [PATCH v2 3/3] dt-bindings: add self-test fixtures for style checker
From: Rob Herring
Date: Wed May 06 2026 - 14:38:57 EST
On Wed, Apr 29, 2026 at 03:21:39PM +0100, Daniel Golle wrote:
> Provide good/ and bad/ DTS and YAML fixtures plus a small runner that
> feeds them to dt-check-style and diffs the output against expected
> text files. Wired into a new top-level dt_style_selftest make target
> so the suite can be exercised independently of the full tree.
>
> Signed-off-by: Daniel Golle <daniel@xxxxxxxxxxxxxx>
> ---
> Changes since v1:
> - new patch (Krzysztof: "would be happy to see at least a few test
> cases for it")
>
> Makefile | 6 ++
> .../dtc/dt-style-selftest/bad/dts-spaces.dts | 13 ++++
> .../bad/yaml-child-addr-order.yaml | 41 ++++++++++++
> .../bad/yaml-child-name-order.yaml | 37 ++++++++++
> .../bad/yaml-cont-align.yaml | 30 +++++++++
> .../dt-style-selftest/bad/yaml-hex-case.yaml | 29 ++++++++
> .../bad/yaml-indent-strict.yaml | 29 ++++++++
> .../bad/yaml-line-length.yaml | 29 ++++++++
> .../bad/yaml-mixed-indent.yaml | 29 ++++++++
> .../bad/yaml-node-close.yaml | 31 +++++++++
> .../bad/yaml-prop-order.yaml | 29 ++++++++
> .../bad/yaml-prop-pairing.yaml | 33 +++++++++
> .../bad/yaml-required-blank.yaml | 33 +++++++++
> .../dtc/dt-style-selftest/bad/yaml-tab.yaml | 29 ++++++++
> .../bad/yaml-trailing-ws.yaml | 29 ++++++++
> .../dt-style-selftest/bad/yaml-unit-addr.yaml | 29 ++++++++
> .../bad/yaml-unused-label.yaml | 29 ++++++++
> .../dt-style-selftest/bad/yaml-value-ws.yaml | 29 ++++++++
> .../expected/dts-spaces.dts.txt | 2 +
> .../expected/yaml-child-addr-order.yaml.txt | 2 +
> .../expected/yaml-child-name-order.yaml.txt | 2 +
> .../expected/yaml-cont-align.yaml.txt | 2 +
> .../expected/yaml-hex-case.yaml.txt | 2 +
> .../expected/yaml-indent-strict.yaml.txt | 2 +
> .../expected/yaml-line-length.yaml.txt | 2 +
> .../expected/yaml-mixed-indent.yaml.txt | 3 +
> .../expected/yaml-node-close.yaml.txt | 2 +
> .../expected/yaml-prop-order.yaml.txt | 2 +
> .../expected/yaml-prop-pairing.yaml.txt | 3 +
> .../expected/yaml-required-blank.yaml.txt | 3 +
> .../expected/yaml-tab.yaml.txt | 2 +
> .../expected/yaml-trailing-ws.yaml.txt | 2 +
> .../expected/yaml-unit-addr.yaml.txt | 2 +
> .../expected/yaml-unused-label.yaml.txt | 2 +
> .../expected/yaml-value-ws.yaml.txt | 2 +
All these .txt files need a newline at the end.
> .../dtc/dt-style-selftest/good/dts-tab.dts | 30 +++++++++
> .../dt-style-selftest/good/yaml-4space.yaml | 41 ++++++++++++
> scripts/dtc/dt-style-selftest/run.sh | 67 +++++++++++++++++++
> 38 files changed, 689 insertions(+)