devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ayush Singh <ayush@beagleboard.org>
To: d-gole@ti.com, lorforlinux@beagleboard.org,
	jkridner@beagleboard.org,  robertcnelson@beagleboard.org,
	nenad.marinkovic@mikroe.com,  Andrew Davis <afd@ti.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	 Robert Nelson <robertcnelson@gmail.com>
Cc: devicetree-compiler@vger.kernel.org,
	 Ayush Singh <ayush@beagleboard.org>
Subject: [PATCH v3 2/2] tests: Add test for append-property
Date: Mon, 11 Nov 2024 15:24:34 +0530	[thread overview]
Message-ID: <20241111-append-v3-2-609c09401f3f@beagleboard.org> (raw)
In-Reply-To: <20241111-append-v3-0-609c09401f3f@beagleboard.org>

- Test /append-property/ on a string and int array.
- Also test on subnode property.

Signed-off-by: Ayush Singh <ayush@beagleboard.org>
---
 tests/append_prop.dts | 21 +++++++++++++++++++++
 tests/run_tests.sh    |  7 +++++++
 2 files changed, 28 insertions(+)

diff --git a/tests/append_prop.dts b/tests/append_prop.dts
new file mode 100644
index 0000000000000000000000000000000000000000..248d4ed5ce5a753c9444d21359249669d88b7784
--- /dev/null
+++ b/tests/append_prop.dts
@@ -0,0 +1,21 @@
+/dts-v1/;
+
+/ {
+	str-prop = "0";
+	num-prop = <2>;
+
+	subnode{
+		str-prop = "0";
+		num-prop = <2>;
+	};
+};
+
+/ {
+	/append-property/ str-prop = "1";
+	/append-property/ num-prop = <1>;
+
+	subnode{
+		/append-property/ str-prop = "1";
+		/append-property/ num-prop = <1>;
+	};
+};
diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 937b128864d03a2aaa8edc171d7ec7bd8fa28569..571980a155ac4510c77686c254ee809a0f4ff108 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -708,6 +708,13 @@ dtc_tests () {
     run_dtc_test -I dts -O dtb -o dtc_tree1_delete.test.dtb "$SRCDIR/test_tree1_delete.dts"
     tree1_tests dtc_tree1_delete.test.dtb
 
+    # Check prop append functionality
+    run_dtc_test -I dts -O dtb -o append_prop.test.dtb "$SRCDIR/append_prop.dts"
+    run_fdtget_test "0 1" append_prop.test.dtb "/" "str-prop"
+    run_fdtget_test "2 1" append_prop.test.dtb "/" "num-prop"
+    run_fdtget_test "0 1" append_prop.test.dtb "/subnode" "str-prop"
+    run_fdtget_test "2 1" append_prop.test.dtb "/subnode" "num-prop"
+
     # Check omit-if-no-ref functionality
     run_dtc_test -I dts -O dtb -o omit-no-ref.test.dtb "$SRCDIR/omit-no-ref.dts"
     run_test check_path omit-no-ref.test.dtb not-exists "/node1"

-- 
2.47.0


  parent reply	other threads:[~2024-11-11  9:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-11  9:54 [PATCH v3 0/2] Add capability to append to property Ayush Singh
2024-11-11  9:54 ` [PATCH v3 1/2] dtc: Add /append-property/ Ayush Singh
2024-11-15  4:07   ` Dhruva Gole
2024-11-11  9:54 ` Ayush Singh [this message]
2024-12-04 13:29 ` [PATCH v3 0/2] Add capability to append to property Ayush Singh
2024-12-10 15:34 ` Andreas Gnau
2024-12-11  4:51   ` Ayush Singh
2024-12-16  6:09   ` David Gibson
2024-12-20 15:30     ` Ayush Singh
2024-12-26  6:54       ` David Gibson
2024-12-26 11:10         ` Geert Uytterhoeven
2024-12-27  4:05           ` David Gibson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241111-append-v3-2-609c09401f3f@beagleboard.org \
    --to=ayush@beagleboard.org \
    --cc=afd@ti.com \
    --cc=d-gole@ti.com \
    --cc=devicetree-compiler@vger.kernel.org \
    --cc=geert@linux-m68k.org \
    --cc=jkridner@beagleboard.org \
    --cc=lorforlinux@beagleboard.org \
    --cc=nenad.marinkovic@mikroe.com \
    --cc=robertcnelson@beagleboard.org \
    --cc=robertcnelson@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).