All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Ayush Singh <ayush@beagleboard.org>
Cc: Andreas Gnau <andreas.gnau@iopsys.eu>,
	d-gole@ti.com, lorforlinux@beagleboard.org,
	jkridner@beagleboard.org, robertcnelson@beagleboard.org,
	Andrew Davis <afd@ti.com>,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Simon Glass <sjg@chromium.org>,
	devicetree-compiler@vger.kernel.org
Subject: Re: [PATCH 3/3] tests: Add test for /./
Date: Wed, 5 Mar 2025 15:17:24 +1100	[thread overview]
Message-ID: <Z8fQVMAVtpaKRe1Y@zatzit> (raw)
In-Reply-To: <20250301-previous-value-v1-3-71d612eb0ea9@beagleboard.org>

[-- Attachment #1: Type: text/plain, Size: 2615 bytes --]

On Sat, Mar 01, 2025 at 06:55:04PM +0530, Ayush Singh wrote:
> - Test /./ on a string and int array.
> - Also test on subnode property.

These tests are ok as far as they go.  Testing  a property with mixed
data types would be a good idea for completeness.

> 
> Signed-off-by: Ayush Singh <ayush@beagleboard.org>
> ---
>  tests/prev_prop.dts | 21 +++++++++++++++++++++
>  tests/run_tests.sh  |  7 +++++++
>  2 files changed, 28 insertions(+)
> 
> diff --git a/tests/prev_prop.dts b/tests/prev_prop.dts
> new file mode 100644
> index 0000000000000000000000000000000000000000..41a0e19015b006d78a3ec35a26db63982ec4c90a
> --- /dev/null
> +++ b/tests/prev_prop.dts
> @@ -0,0 +1,21 @@
> +/dts-v1/;
> +
> +/ {
> +        str-prop = "1", "2";
> +        int-prop = <1 2>;
> +
> +        subnode {
> +                str-prop = "1", "2";
> +                int-prop = <1 2>;
> +        };
> +};
> +
> +/ {
> +        str-prop = /./, "3", "4", /./, "6";
> +        int-prop = /./, <3 4>, /./, <6>;
> +
> +        subnode {
> +                str-prop = /./, "3", "4", /./;
> +                int-prop = /./, <3 4>, /./;
> +        };
> +};
> diff --git a/tests/run_tests.sh b/tests/run_tests.sh
> index f0b51c04bf0af69f1df483b185f3aefa5d0bae27..30aa99f55570ac10b85c94353711361c19a5b479 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 previous property functionality
> +    run_dtc_test -I dts -O dtb -o prev_prop.test.dtb "$SRCDIR/prev_prop.dts"
> +    run_fdtget_test "1 2 3 4 1 2 6" prev_prop.test.dtb "/" "str-prop"
> +    run_fdtget_test "1 2 3 4 1 2 6" prev_prop.test.dtb "/" "int-prop"
> +    run_fdtget_test "1 2 3 4 1 2" prev_prop.test.dtb "/subnode" "str-prop"
> +    run_fdtget_test "1 2 3 4 1 2" prev_prop.test.dtb "/subnode"
> "int-prop"

Rather than have a batch of separate fdtget tests, I think it would be
cleaner to create a different .dts with the expected output from the
expansions, then compare them with dtbs_equal_ordered.

> +
>      # 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"
> 

-- 
David Gibson (he or they)	| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you, not the other way
				| around.
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2025-03-05  4:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-01 13:25 [PATCH 0/3] Add capability to create property from old property Ayush Singh
2025-03-01 13:25 ` [PATCH 1/3] Add alloc_marker Ayush Singh
2025-03-03  9:35   ` David Gibson
2025-03-01 13:25 ` [PATCH 2/3] dtc: Add /./ Ayush Singh
2025-03-05  4:14   ` David Gibson
2025-03-01 13:25 ` [PATCH 3/3] tests: Add test for /./ Ayush Singh
2025-03-05  4:17   ` David Gibson [this message]
2025-03-03  9:02 ` [PATCH 0/3] Add capability to create property from old property 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=Z8fQVMAVtpaKRe1Y@zatzit \
    --to=david@gibson.dropbear.id.au \
    --cc=afd@ti.com \
    --cc=andreas.gnau@iopsys.eu \
    --cc=ayush@beagleboard.org \
    --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=robertcnelson@beagleboard.org \
    --cc=sjg@chromium.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.