From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Gibson Subject: Re: [PATCH v11 4/7] tests: Add overlay tests Date: Tue, 29 Nov 2016 14:08:07 +1100 Message-ID: <20161129030807.GH13307@umbus.fritz.box> References: <1480349141-14145-1-git-send-email-pantelis.antoniou@konsulko.com> <1480349141-14145-5-git-send-email-pantelis.antoniou@konsulko.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Uu2n37VG4rOBDVuR" Return-path: Content-Disposition: inline In-Reply-To: <1480349141-14145-5-git-send-email-pantelis.antoniou-OWPKS81ov/FWk0Htik3J/w@public.gmane.org> Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Pantelis Antoniou Cc: Jon Loeliger , Grant Likely , Frank Rowand , Rob Herring , Jan Luebbe , Sascha Hauer , Phil Elwell , Simon Glass , Maxime Ripard , Thomas Petazzoni , Boris Brezillon , Antoine Tenart , Stephen Boyd , Devicetree Compiler , devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: devicetree@vger.kernel.org --Uu2n37VG4rOBDVuR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Nov 28, 2016 at 06:05:38PM +0200, Pantelis Antoniou wrote: > Add a number of tests for dynamic objects/overlays. >=20 > Re-use the original test by moving the contents to a .dtsi include >=20 > Signed-off-by: Pantelis Antoniou > --- > 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 >=20 > 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/; > =20 > -/ { > - /* Test that we can change an int by another */ > - fragment@0 { > - target =3D <&test>; > - > - __overlay__ { > - test-int-property =3D <43>; > - }; > - }; > - > - /* Test that we can replace a string by a longer one */ > - fragment@1 { > - target =3D <&test>; > - > - __overlay__ { > - test-str-property =3D "foobar"; > - }; > - }; > - > - /* Test that we add a new property */ > - fragment@2 { > - target =3D <&test>; > - > - __overlay__ { > - test-str-property-2 =3D "foobar2"; > - }; > - }; > - > - /* Test that we add a new node (by phandle) */ > - fragment@3 { > - target =3D <&test>; > - > - __overlay__ { > - new-node { > - new-property; > - }; > - }; > - }; > - > - fragment@5 { > - target =3D <&test>; > - > - __overlay__ { > - local: new-local-node { > - new-property; > - }; > - }; > - }; > - > - fragment@6 { > - target =3D <&test>; > - > - __overlay__ { > - test-phandle =3D <&test>, <&local>; > - }; > - }; > - > - fragment@7 { > - target =3D <&test>; > - > - __overlay__ { > - test-several-phandle =3D <&local>, <&local>; > - }; > - }; > - > - fragment@8 { > - target =3D <&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. > diff --git a/tests/overlay_overlay_dtc.dtsi b/tests/overlay_overlay_dtc.d= tsi > 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 =3D <&test>; > + > + __overlay__ { > + test-int-property =3D <43>; > + }; > + }; > + > + /* Test that we can replace a string by a longer one */ > + fragment@1 { > + target =3D <&test>; > + > + __overlay__ { > + test-str-property =3D "foobar"; > + }; > + }; > + > + /* Test that we add a new property */ > + fragment@2 { > + target =3D <&test>; > + > + __overlay__ { > + test-str-property-2 =3D "foobar2"; > + }; > + }; > + > + /* Test that we add a new node (by phandle) */ > + fragment@3 { > + target =3D <&test>; > + > + __overlay__ { > + new-node { > + new-property; > + }; > + }; > + }; > + > + fragment@5 { > + target =3D <&test>; > + > + __overlay__ { > + local: new-local-node { > + new-property; > + }; > + }; > + }; > + > + fragment@6 { > + target =3D <&test>; > + > + __overlay__ { > + test-phandle =3D <&test>, <&local>; > + }; > + }; > + > + fragment@7 { > + target =3D <&test>; > + > + __overlay__ { > + test-several-phandle =3D <&local>, <&local>; > + }; > + }; > + > + fragment@8 { > + target =3D <&test>; > + > + __overlay__ { > + sub-test-node { > + new-sub-test-property; > + }; > + }; > + }; > +}; > diff --git a/tests/overlay_overlay_new_dtc.dts b/tests/overlay_overlay_ne= w_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_sim= ple.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 =3D <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.te= st.dtb overlay_overlay_dtc.dts > run_test overlay overlay_base_with_symbols.test.dtb overlay_over= lay_with_symbols.test.dtb > + > + # new /plugin/ format > + run_dtc_test -@ -I dts -O dtb -o overlay_overlay_new_with_symbol= s.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. > + # test new magic option > + run_dtc_test -M@ -I dts -O dtb -o overlay_overlay_with_symbols_n= ew_magic.test.dtb overlay_overlay_dtc.dts > + run_test check_path overlay_overlay_with_symbols_new_magic.test.dtb exi= sts "/__symbols__" > + run_test check_path overlay_overlay_with_symbols_new_magic.test.dtb exi= sts "/__fixups__" > + run_test check_path overlay_overlay_with_symbols_new_magic.test.dtb exi= sts "/__local_fixups__" > + > + # test plugin source to dtb and back > + run_dtc_test -@ -I dtb -O dts -o overlay_overlay_dtc.test.dts ov= erlay_overlay_with_symbols.test.dtb > + run_dtc_test -@ -I dts -O dtb -o overlay_overlay_with_symbols.te= st.test.dtb overlay_overlay_dtc.test.dts > + run_test dtbs_equal_ordered overlay_overlay_with_symbols.test.dt= b 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.t= est.dts overlay_overlay_with_symbols_new_magic.test.dtb > + run_dtc_test -@ -I dts -O dtb -o overlay_overlay_with_symbols_ne= w_magic.test.test.dtb overlay_overlay_dtc_new_magic.test.dts > + run_test dtbs_equal_ordered overlay_overlay_with_symbols_new_mag= ic.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_a= uto.test.dtb overlay_overlay_dtc.dts > + run_test check_path overlay_overlay_new_with_symbols_auto.test.dtb exis= ts "/__symbols__" > + run_test check_path overlay_overlay_new_with_symbols_auto.test.dtb exis= ts "/__fixups__" > + run_test check_path overlay_overlay_new_with_symbols_auto.test.dtb exis= ts "/__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-ex= ists "/__fixups__" > + run_test check_path overlay_base_with_symbols_no_fixups.test.dtb not-ex= ists "/__local_fixups__" > + > + # Test generation of aliases insted of symbols > + run_dtc_test -A -I dts -O dtb -o overlay_overlay_with_aliases.dt= b 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_f= ixups__" > fi > =20 > # Bad fixup tests --=20 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 --Uu2n37VG4rOBDVuR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBCAAGBQJYPPEUAAoJEGw4ysog2bOSf3wQAN82vYieClP1gIhfc2NWstej yvBYa6kuDqwpqfAzUJnXRnZuq0eeBQqUyuw67qPHJsTbtsMxIqoreakuRr/1UJ6t feuGvnw+rFFhCwuvZj5tvn8Jb7W31GKK61va5Wjq6xZuTU4EOpfQ4qxHXHhdgvYD NjfR1eyJJSQbdGBlhTKHVR3nbxpRKsdU1WW73S1PmBuygdQJgswJCraXPUOz4DNW Y2Z+Q7vTH+ff+qQTTB9+hUOSqkLlG+UP0klsD75g2UJOboVu1HK8HWGX+1ra7aLs JlDTNTIpdz5r5xTKdfF34SsXLnuC0rQFNoOUHTgVmYB56oLskoo1vZxGqA2Rf6CN hbRvwJnbxq/hZyEjQVaM2VfKnHiYx6jDuihuLvDyES66kLd49DdxCLKDr3KkGJr3 uWr7yfH7yfwLS1R/Q6fYQZV9hU3ZHvUWiHBC8pCT1DktvmvU+NHtFCJefuCIJQAl k0O3k/zQ89NFdC8QdUZR8I0UHJFy7xJKHNU1y/4mpu5YnPIM2MUihDrMJZ2qBdrB jDfw5E/yV6jQ/9CJlrZ8XFlR1tph+oRcFv+61Rvk+4ThzCsx8jGpEk6il/eBHhL+ xdfLDWYH2D7s37aGphXnilZ6j3E2MStIwq5SBiAvJcFyDuF6UcHb/Qj659AknwN0 lDm0cxsjnL8hTUt4XAbm =RjyD -----END PGP SIGNATURE----- --Uu2n37VG4rOBDVuR-- -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html