All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org>
To: Pantelis Antoniou
	<pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
Cc: Jon Loeliger <jdl-CYoMK+44s/E@public.gmane.org>,
	Grant Likely <glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>,
	Frank Rowand
	<frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Rob Herring <robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Jan Luebbe <jlu-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Sascha Hauer <s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>,
	Phil Elwell <phil-FnsA7b+Nu9XbIbC87yuRow@public.gmane.org>,
	Simon Glass <sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
	Maxime Ripard
	<maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Thomas Petazzoni
	<thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Boris Brezillon
	<boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Antoine Tenart
	<antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>,
	Stephen Boyd
	<stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Devicetree Compiler
	<devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v11 4/7] tests: Add overlay tests
Date: Wed, 30 Nov 2016 11:35:49 +1100	[thread overview]
Message-ID: <20161130003549.GB19891@umbus> (raw)
In-Reply-To: <17F182F7-CDF7-4052-86C2-B40505706ED4-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>

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

On Tue, Nov 29, 2016 at 01:11:43PM +0200, Pantelis Antoniou wrote:
> Hi David,
> 
> > On Nov 29, 2016, at 05:08 , David Gibson <david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org> wrote:
> > 
> > On Mon, Nov 28, 2016 at 06:05:38PM +0200, Pantelis Antoniou wrote:
> >> Add a number of tests for dynamic objects/overlays.
> >> 
> >> Re-use the original test by moving the contents to a .dtsi include
> >> 
> >> Signed-off-by: Pantelis Antoniou <pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
> >> ---
> >> tests/overlay_overlay_dtc.dts     | 76 +----------------------------------
> >> tests/overlay_overlay_dtc.dtsi    | 83 +++++++++++++++++++++++++++++++++++++++
> >> tests/overlay_overlay_new_dtc.dts | 11 ++++++
> >> tests/overlay_overlay_simple.dts  | 12 ++++++
> >> tests/run_tests.sh                | 41 +++++++++++++++++++
> >> 5 files changed, 148 insertions(+), 75 deletions(-)
> >> create mode 100644 tests/overlay_overlay_dtc.dtsi
> >> create mode 100644 tests/overlay_overlay_new_dtc.dts
> >> create mode 100644 tests/overlay_overlay_simple.dts
> >> 
> >> diff --git a/tests/overlay_overlay_dtc.dts b/tests/overlay_overlay_dtc.dts
> >> index 30d2362..ca943ea 100644
> >> --- a/tests/overlay_overlay_dtc.dts
> >> +++ b/tests/overlay_overlay_dtc.dts
> >> @@ -8,78 +8,4 @@
> >> /dts-v1/;
> >> /plugin/;
> >> 
> >> -/ {
> >> -	/* Test that we can change an int by another */
> >> -	fragment@0 {
> >> -		target = <&test>;
> >> -
> >> -		__overlay__ {
> >> -			test-int-property = <43>;
> >> -		};
> >> -	};
> >> -
> >> -	/* Test that we can replace a string by a longer one */
> >> -	fragment@1 {
> >> -		target = <&test>;
> >> -
> >> -		__overlay__ {
> >> -			test-str-property = "foobar";
> >> -		};
> >> -	};
> >> -
> >> -	/* Test that we add a new property */
> >> -	fragment@2 {
> >> -		target = <&test>;
> >> -
> >> -		__overlay__ {
> >> -			test-str-property-2 = "foobar2";
> >> -		};
> >> -	};
> >> -
> >> -	/* Test that we add a new node (by phandle) */
> >> -	fragment@3 {
> >> -		target = <&test>;
> >> -
> >> -		__overlay__ {
> >> -			new-node {
> >> -				new-property;
> >> -			};
> >> -		};
> >> -	};
> >> -
> >> -	fragment@5 {
> >> -		target = <&test>;
> >> -
> >> -		__overlay__ {
> >> -			local: new-local-node {
> >> -				new-property;
> >> -			};
> >> -		};
> >> -	};
> >> -
> >> -	fragment@6 {
> >> -		target = <&test>;
> >> -
> >> -		__overlay__ {
> >> -			test-phandle = <&test>, <&local>;
> >> -		};
> >> -	};
> >> -
> >> -	fragment@7 {
> >> -		target = <&test>;
> >> -
> >> -		__overlay__ {
> >> -			test-several-phandle = <&local>, <&local>;
> >> -		};
> >> -	};
> >> -
> >> -	fragment@8 {
> >> -		target = <&test>;
> >> -
> >> -		__overlay__ {
> >> -			sub-test-node {
> >> -				new-sub-test-property;
> >> -			};
> >> -		};
> >> -	};
> >> -};
> >> +/include/ "overlay_overlay_dtc.dtsi"
> > 
> > Don't duplicate this, just replace it with the new style.  This only
> > existed as essentially documentation for the libfdt overlay
> > application stuff.  Since the new dtc won't support the old tag
> > format, there's no point having a test for it.
> 
> The parser now handles both tag formats just fine. I could remove support
> for it if you’re willing to tackle the flak.

Oh, sorry, I missed that.

I'd suggest having that controlled by the same "backwards compat"
option to control magic number and other things.  Although changing
parser behaviour based on flags can get fiddly.

> 
> >> diff --git a/tests/overlay_overlay_dtc.dtsi b/tests/overlay_overlay_dtc.dtsi
> >> new file mode 100644
> >> index 0000000..8ea8d5d
> >> --- /dev/null
> >> +++ b/tests/overlay_overlay_dtc.dtsi
> >> @@ -0,0 +1,83 @@
> >> +/*
> >> + * Copyright (c) 2016 NextThing Co
> >> + * Copyright (c) 2016 Free Electrons
> >> + * Copyright (c) 2016 Konsulko Inc.
> >> + *
> >> + * SPDX-License-Identifier:	GPL-2.0+
> >> + */
> >> +
> >> +/ {
> >> +	/* Test that we can change an int by another */
> >> +	fragment@0 {
> >> +		target = <&test>;
> >> +
> >> +		__overlay__ {
> >> +			test-int-property = <43>;
> >> +		};
> >> +	};
> >> +
> >> +	/* Test that we can replace a string by a longer one */
> >> +	fragment@1 {
> >> +		target = <&test>;
> >> +
> >> +		__overlay__ {
> >> +			test-str-property = "foobar";
> >> +		};
> >> +	};
> >> +
> >> +	/* Test that we add a new property */
> >> +	fragment@2 {
> >> +		target = <&test>;
> >> +
> >> +		__overlay__ {
> >> +			test-str-property-2 = "foobar2";
> >> +		};
> >> +	};
> >> +
> >> +	/* Test that we add a new node (by phandle) */
> >> +	fragment@3 {
> >> +		target = <&test>;
> >> +
> >> +		__overlay__ {
> >> +			new-node {
> >> +				new-property;
> >> +			};
> >> +		};
> >> +	};
> >> +
> >> +	fragment@5 {
> >> +		target = <&test>;
> >> +
> >> +		__overlay__ {
> >> +			local: new-local-node {
> >> +				new-property;
> >> +			};
> >> +		};
> >> +	};
> >> +
> >> +	fragment@6 {
> >> +		target = <&test>;
> >> +
> >> +		__overlay__ {
> >> +			test-phandle = <&test>, <&local>;
> >> +		};
> >> +	};
> >> +
> >> +	fragment@7 {
> >> +		target = <&test>;
> >> +
> >> +		__overlay__ {
> >> +			test-several-phandle = <&local>, <&local>;
> >> +		};
> >> +	};
> >> +
> >> +	fragment@8 {
> >> +		target = <&test>;
> >> +
> >> +		__overlay__ {
> >> +			sub-test-node {
> >> +				new-sub-test-property;
> >> +			};
> >> +		};
> >> +	};
> >> +};
> >> diff --git a/tests/overlay_overlay_new_dtc.dts b/tests/overlay_overlay_new_dtc.dts
> >> new file mode 100644
> >> index 0000000..14d3f54
> >> --- /dev/null
> >> +++ b/tests/overlay_overlay_new_dtc.dts
> >> @@ -0,0 +1,11 @@
> >> +/*
> >> + * Copyright (c) 2016 NextThing Co
> >> + * Copyright (c) 2016 Free Electrons
> >> + * Copyright (c) 2016 Konsulko Inc.
> >> + *
> >> + * SPDX-License-Identifier:	GPL-2.0+
> >> + */
> >> +
> >> +/dts-v1/ /plugin/;
> >> +
> >> +/include/ "overlay_overlay_dtc.dtsi"
> >> diff --git a/tests/overlay_overlay_simple.dts b/tests/overlay_overlay_simple.dts
> >> new file mode 100644
> >> index 0000000..8657e1e
> >> --- /dev/null
> >> +++ b/tests/overlay_overlay_simple.dts
> >> @@ -0,0 +1,12 @@
> >> +/*
> >> + * Copyright (c) 2016 Konsulko Inc.
> >> + *
> >> + * SPDX-License-Identifier:	GPL-2.0+
> >> + */
> >> +
> >> +/dts-v1/;
> >> +/plugin/;
> >> +
> >> +&test {
> >> +	test-int-property = <43>;
> >> +};
> >> diff --git a/tests/run_tests.sh b/tests/run_tests.sh
> >> index e4139dd..74af0ff 100755
> >> --- a/tests/run_tests.sh
> >> +++ b/tests/run_tests.sh
> >> @@ -181,6 +181,47 @@ overlay_tests () {
> >>         run_dtc_test -@ -I dts -O dtb -o overlay_base_with_symbols.test.dtb overlay_base.dts
> >>         run_dtc_test -@ -I dts -O dtb -o overlay_overlay_with_symbols.test.dtb overlay_overlay_dtc.dts
> >>         run_test overlay overlay_base_with_symbols.test.dtb overlay_overlay_with_symbols.test.dtb
> >> +
> >> +        # new /plugin/ format
> >> +        run_dtc_test -@ -I dts -O dtb -o overlay_overlay_new_with_symbols.test.dtb overlay_overlay_new_dtc.dts
> >> +	run_test check_path overlay_overlay_new_with_symbols.test.dtb exists "/__symbols__"
> >> +	run_test check_path overlay_overlay_new_with_symbols.test.dtb exists "/__fixups__"
> >> +	run_test check_path overlay_overlay_new_with_symbols.test.dtb exists "/__local_fixups__"
> > 
> > Looks like you're mixing tabs and spaces here.  I don't really mind
> > which, but keep it consistent at least at the same indentation level.
> > 
> 
> Oh, sorry, I use tabs but this sections has spaces… Will fix.

Well, it's more tha the first line in the block seems to be using
spaces, then the rest using tabs.

> 
> >> +        # test new magic option
> >> +        run_dtc_test -M@ -I dts -O dtb -o overlay_overlay_with_symbols_new_magic.test.dtb overlay_overlay_dtc.dts
> >> +	run_test check_path overlay_overlay_with_symbols_new_magic.test.dtb exists "/__symbols__"
> >> +	run_test check_path overlay_overlay_with_symbols_new_magic.test.dtb exists "/__fixups__"
> >> +	run_test check_path overlay_overlay_with_symbols_new_magic.test.dtb exists "/__local_fixups__"
> >> +
> >> +        # test plugin source to dtb and back
> >> +        run_dtc_test -@ -I dtb -O dts -o overlay_overlay_dtc.test.dts overlay_overlay_with_symbols.test.dtb
> >> +        run_dtc_test -@ -I dts -O dtb -o overlay_overlay_with_symbols.test.test.dtb overlay_overlay_dtc.test.dts
> >> +        run_test dtbs_equal_ordered overlay_overlay_with_symbols.test.dtb overlay_overlay_with_symbols.test.test.dtb
> >> +
> >> +	# test plugin source to dtb and back (with new magic)
> >> +        run_dtc_test -@ -I dtb -O dts -o overlay_overlay_dtc_new_magic.test.dts overlay_overlay_with_symbols_new_magic.test.dtb
> >> +        run_dtc_test -@ -I dts -O dtb -o overlay_overlay_with_symbols_new_magic.test.test.dtb overlay_overlay_dtc_new_magic.test.dts
> >> +        run_test dtbs_equal_ordered overlay_overlay_with_symbols_new_magic.test.dtb overlay_overlay_with_symbols_new_magic.test.test.dtb
> >> +
> >> +        # test plugin auto-generation without using -@
> >> +        run_dtc_test -I dts -O dtb -o overlay_overlay_new_with_symbols_auto.test.dtb overlay_overlay_dtc.dts
> >> +	run_test check_path overlay_overlay_new_with_symbols_auto.test.dtb exists "/__symbols__"
> >> +	run_test check_path overlay_overlay_new_with_symbols_auto.test.dtb exists "/__fixups__"
> >> +	run_test check_path overlay_overlay_new_with_symbols_auto.test.dtb exists "/__local_fixups__"
> >> +
> >> +        # Test suppression of fixups
> >> +        run_dtc_test -F -@ -I dts -O dtb -o overlay_base_with_symbols_no_fixups.test.dtb overlay_base.dts
> >> +	run_test check_path overlay_base_with_symbols_no_fixups.test.dtb exists "/__symbols__"
> >> +	run_test check_path overlay_base_with_symbols_no_fixups.test.dtb not-exists "/__fixups__"
> >> +	run_test check_path overlay_base_with_symbols_no_fixups.test.dtb not-exists "/__local_fixups__"
> >> +
> >> +        # Test generation of aliases insted of symbols
> >> +        run_dtc_test -A -I dts -O dtb -o overlay_overlay_with_aliases.dtb overlay_overlay_dtc.dts
> >> +	run_test check_path overlay_overlay_with_aliases.dtb exists "/aliases"
> >> +	run_test check_path overlay_overlay_with_aliases.dtb exists "/__symbols__"
> >> +	run_test check_path overlay_overlay_with_aliases.dtb exists "/__fixups__"
> >> +	run_test check_path overlay_overlay_with_aliases.dtb exists "/__local_fixups__"
> >>     fi
> >> 
> >>     # Bad fixup tests
> > 
> 
> Regards
> 
> — Pantelis
> 

-- 
David Gibson			| 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: 819 bytes --]

  parent reply	other threads:[~2016-11-30  0:35 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-28 16:05 [PATCH v11 0/4] dtc: Dynamic DT support Pantelis Antoniou
     [not found] ` <1480349141-14145-1-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-11-28 16:05   ` [PATCH v11 1/7] dtc: Document the dynamic plugin internals Pantelis Antoniou
2016-11-28 16:05   ` [PATCH v11 2/7] dtc: Plugin and fixup support Pantelis Antoniou
     [not found]     ` <1480349141-14145-3-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-11-29  2:38       ` David Gibson
2016-11-28 16:05   ` [PATCH v11 3/7] tests: Add check_path test Pantelis Antoniou
     [not found]     ` <1480349141-14145-4-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-11-29  2:40       ` David Gibson
2016-11-28 16:05   ` [PATCH v11 4/7] tests: Add overlay tests Pantelis Antoniou
     [not found]     ` <1480349141-14145-5-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-11-29  3:08       ` David Gibson
     [not found]         ` <20161129030807.GH13307-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2016-11-29 11:11           ` Pantelis Antoniou
     [not found]             ` <17F182F7-CDF7-4052-86C2-B40505706ED4-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-11-30  0:35               ` David Gibson [this message]
2016-11-30  9:04                 ` Pantelis Antoniou
2016-11-28 16:05   ` [PATCH v11 5/7] overlay: Documentation for the overlay sugar syntax Pantelis Antoniou
     [not found]     ` <1480349141-14145-6-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org>
2016-11-29  3:10       ` David Gibson
     [not found]         ` <20161129031054.GI13307-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2016-11-29  4:36           ` Frank Rowand
     [not found]             ` <583D05B7.4040109-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-29  5:10               ` David Gibson
     [not found]                 ` <20161129051042.GO13307-K0bRW+63XPQe6aEkudXLsA@public.gmane.org>
2016-11-29 16:45                   ` Frank Rowand
     [not found]                     ` <583DB09C.7060105-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-11-30  0:39                       ` David Gibson
2016-11-30  9:07                         ` Pantelis Antoniou
2016-11-28 16:05   ` [PATCH v11 6/7] overlay: Add syntactic sugar version of overlays Pantelis Antoniou
2016-11-28 16:05   ` [PATCH v11 7/7] tests: Add a test for overlays syntactic sugar Pantelis Antoniou

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=20161130003549.GB19891@umbus \
    --to=david-xt8fgy+axnrb3ne2bgzf6laj5h9x9tb+@public.gmane.org \
    --cc=antoine.tenart-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=boris.brezillon-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=frowand.list-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=glikely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org \
    --cc=jdl-CYoMK+44s/E@public.gmane.org \
    --cc=jlu-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org \
    --cc=pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org \
    --cc=phil-FnsA7b+Nu9XbIbC87yuRow@public.gmane.org \
    --cc=robherring2-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=s.hauer-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org \
    --cc=sjg-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=thomas.petazzoni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.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.