devicetree-compiler.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] tests: add -a option cases
@ 2016-07-13 11:35 Tim Wang
       [not found] ` <1468409701-3310-1-git-send-email-timwang-XOWFcpiLszpWk0Htik3J/w@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Tim Wang @ 2016-07-13 11:35 UTC (permalink / raw)
  To: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA
  Cc: wtt_usst-9Onoh4P/yGk, timwang-XOWFcpiLszpWk0Htik3J/w

Signed-off-by: Tim Wang <timwang-XOWFcpiLszpWk0Htik3J/w@public.gmane.org>
---
 tests/run_tests.sh | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/run_tests.sh b/tests/run_tests.sh
index 7eb9b3d..6aed6d6 100755
--- a/tests/run_tests.sh
+++ b/tests/run_tests.sh
@@ -579,9 +579,10 @@ fdtput_tests () {
     dts=label01.dts
     dtb=$dts.fdtput.test.dtb
     text=lorem.txt
+    align=64
 
     # Allow just enough space for $text
-    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
+    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
 
     # run_fdtput_test <expected-result> <file> <node> <property> <flags> <value>
     run_fdtput_test "a_model" $dtb / model -ts "a_model"
@@ -600,7 +601,7 @@ fdtput_tests () {
     run_fdtput_test "$(cat $text $text)" $dtb /randomnode blob -ts "$(cat $text $text)"
 
     # Start again with a fresh dtb
-    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
+    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
 
     # Node creation
     run_wrap_error_test $DTPUT $dtb -c /baldrick sod
@@ -628,7 +629,7 @@ fdtput_tests () {
     run_wrap_test $DTPUT $dtb -cp /chosen/son
 
     # Start again with a fresh dtb
-    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
+    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
 
     # Node delete
     run_wrap_test $DTPUT $dtb -c /chosen/node1 /chosen/node2 /chosen/node3
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests: add -a option cases
       [not found] ` <1468409701-3310-1-git-send-email-timwang-XOWFcpiLszpWk0Htik3J/w@public.gmane.org>
@ 2016-07-14  9:27   ` David Gibson
       [not found]     ` <20160714092721.GP14615-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: David Gibson @ 2016-07-14  9:27 UTC (permalink / raw)
  To: Tim Wang; +Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA, wtt_usst-9Onoh4P/yGk

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

On Wed, Jul 13, 2016 at 07:35:01PM +0800, Tim Wang wrote:
> Signed-off-by: Tim Wang <timwang-XOWFcpiLszpWk0Htik3J/w@public.gmane.org>

This is a good start.  However it needs some more.

First, you should have some tests which actually check that the
generated blobs have the correct alignment.

Second, you should check more than just one alignment.

> ---
>  tests/run_tests.sh | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/run_tests.sh b/tests/run_tests.sh
> index 7eb9b3d..6aed6d6 100755
> --- a/tests/run_tests.sh
> +++ b/tests/run_tests.sh
> @@ -579,9 +579,10 @@ fdtput_tests () {
>      dts=label01.dts
>      dtb=$dts.fdtput.test.dtb
>      text=lorem.txt
> +    align=64
>  
>      # Allow just enough space for $text
> -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
>  
>      # run_fdtput_test <expected-result> <file> <node> <property> <flags> <value>
>      run_fdtput_test "a_model" $dtb / model -ts "a_model"
> @@ -600,7 +601,7 @@ fdtput_tests () {
>      run_fdtput_test "$(cat $text $text)" $dtb /randomnode blob -ts "$(cat $text $text)"
>  
>      # Start again with a fresh dtb
> -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
>  
>      # Node creation
>      run_wrap_error_test $DTPUT $dtb -c /baldrick sod
> @@ -628,7 +629,7 @@ fdtput_tests () {
>      run_wrap_test $DTPUT $dtb -cp /chosen/son
>  
>      # Start again with a fresh dtb
> -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
>  
>      # Node delete
>      run_wrap_test $DTPUT $dtb -c /chosen/node1 /chosen/node2 /chosen/node3

-- 
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 --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] tests: add -a option cases
       [not found]     ` <20160714092721.GP14615-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
@ 2016-07-14 10:02       ` Wang Tim(王艇艇)
       [not found]         ` <0524d71d69d240c39c0337ea08a55d5e-w/Y+SVW4SlHx9BLjpE4ezaBKnGwkPULj@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: Wang Tim(王艇艇) @ 2016-07-14 10:02 UTC (permalink / raw)
  To: David Gibson
  Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	wtt_usst-9Onoh4P/yGk@public.gmane.org

Hi David,
Thanks for your review!

I'll add the "actually check" code about the new dtb file with alignment option.
And add more case which combine with other options.

BTW, do I need combine the test patch and "-a option" into one patch?

Best Regards
Tim Wang(王艇艇)


-----Original Message-----
From: David Gibson [mailto:david@gibson.dropbear.id.au] 
Sent: Thursday, July 14, 2016 5:27 PM
To: Wang Tim(王艇艇)
Cc: devicetree-compiler@vger.kernel.org; wtt_usst@163.com
Subject: Re: [PATCH] tests: add -a option cases

On Wed, Jul 13, 2016 at 07:35:01PM +0800, Tim Wang wrote:
> Signed-off-by: Tim Wang <timwang@asrmicro.com>

This is a good start.  However it needs some more.

First, you should have some tests which actually check that the generated blobs have the correct alignment.

Second, you should check more than just one alignment.

> ---
>  tests/run_tests.sh | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 
> 7eb9b3d..6aed6d6 100755
> --- a/tests/run_tests.sh
> +++ b/tests/run_tests.sh
> @@ -579,9 +579,10 @@ fdtput_tests () {
>      dts=label01.dts
>      dtb=$dts.fdtput.test.dtb
>      text=lorem.txt
> +    align=64
>  
>      # Allow just enough space for $text
> -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
>  
>      # run_fdtput_test <expected-result> <file> <node> <property> <flags> <value>
>      run_fdtput_test "a_model" $dtb / model -ts "a_model"
> @@ -600,7 +601,7 @@ fdtput_tests () {
>      run_fdtput_test "$(cat $text $text)" $dtb /randomnode blob -ts "$(cat $text $text)"
>  
>      # Start again with a fresh dtb
> -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
>  
>      # Node creation
>      run_wrap_error_test $DTPUT $dtb -c /baldrick sod @@ -628,7 +629,7 
> @@ fdtput_tests () {
>      run_wrap_test $DTPUT $dtb -cp /chosen/son
>  
>      # Start again with a fresh dtb
> -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
>  
>      # Node delete
>      run_wrap_test $DTPUT $dtb -c /chosen/node1 /chosen/node2 
> /chosen/node3

-- 
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] tests: add -a option cases
       [not found]         ` <0524d71d69d240c39c0337ea08a55d5e-w/Y+SVW4SlHx9BLjpE4ezaBKnGwkPULj@public.gmane.org>
@ 2016-07-15  2:13           ` David Gibson
       [not found]             ` <20160715021314.GS14615-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
  0 siblings, 1 reply; 5+ messages in thread
From: David Gibson @ 2016-07-15  2:13 UTC (permalink / raw)
  To: Wang Tim(王艇艇)
  Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	wtt_usst-9Onoh4P/yGk@public.gmane.org

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

On Thu, Jul 14, 2016 at 10:02:31AM +0000, Wang Tim(王艇艇) wrote:
> Hi David,
> Thanks for your review!
> 
> I'll add the "actually check" code about the new dtb file with alignment option.
> And add more case which combine with other options.
> 
> BTW, do I need combine the test patch and "-a option" into one
> patch?

Either way is ok.  Since they're both fairly small, it's probably
simpler to combine them.

> 
> Best Regards
> Tim Wang(王艇艇)
> 
> 
> -----Original Message-----
> From: David Gibson [mailto:david-xT8FGy+AXnRB3Ne2BGzF6laj5H9X9Tb+@public.gmane.org] 
> Sent: Thursday, July 14, 2016 5:27 PM
> To: Wang Tim(王艇艇)
> Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; wtt_usst-9Onoh4P/yGk@public.gmane.org
> Subject: Re: [PATCH] tests: add -a option cases
> 
> On Wed, Jul 13, 2016 at 07:35:01PM +0800, Tim Wang wrote:
> > Signed-off-by: Tim Wang <timwang-XOWFcpiLszpWk0Htik3J/w@public.gmane.org>
> 
> This is a good start.  However it needs some more.
> 
> First, you should have some tests which actually check that the generated blobs have the correct alignment.
> 
> Second, you should check more than just one alignment.
> 
> > ---
> >  tests/run_tests.sh | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tests/run_tests.sh b/tests/run_tests.sh index 
> > 7eb9b3d..6aed6d6 100755
> > --- a/tests/run_tests.sh
> > +++ b/tests/run_tests.sh
> > @@ -579,9 +579,10 @@ fdtput_tests () {
> >      dts=label01.dts
> >      dtb=$dts.fdtput.test.dtb
> >      text=lorem.txt
> > +    align=64
> >  
> >      # Allow just enough space for $text
> > -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> > +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
> >  
> >      # run_fdtput_test <expected-result> <file> <node> <property> <flags> <value>
> >      run_fdtput_test "a_model" $dtb / model -ts "a_model"
> > @@ -600,7 +601,7 @@ fdtput_tests () {
> >      run_fdtput_test "$(cat $text $text)" $dtb /randomnode blob -ts "$(cat $text $text)"
> >  
> >      # Start again with a fresh dtb
> > -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> > +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
> >  
> >      # Node creation
> >      run_wrap_error_test $DTPUT $dtb -c /baldrick sod @@ -628,7 +629,7 
> > @@ fdtput_tests () {
> >      run_wrap_test $DTPUT $dtb -cp /chosen/son
> >  
> >      # Start again with a fresh dtb
> > -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> > +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb $dts
> >  
> >      # Node delete
> >      run_wrap_test $DTPUT $dtb -c /chosen/node1 /chosen/node2 
> > /chosen/node3
> 

-- 
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 --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] tests: add -a option cases
       [not found]             ` <20160715021314.GS14615-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
@ 2016-07-18  8:21               ` Wang Tim(王艇艇)
  0 siblings, 0 replies; 5+ messages in thread
From: Wang Tim(王艇艇) @ 2016-07-18  8:21 UTC (permalink / raw)
  To: David Gibson
  Cc: devicetree-compiler-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	wtt_usst-9Onoh4P/yGk@public.gmane.org

Hi David,
I've sent V6 patch which combine the test cases
and -a option related codes.
Please help to review, thanks!

Best Regards
Tim Wang(王艇艇)


-----Original Message-----
From: David Gibson [mailto:david@gibson.dropbear.id.au] 
Sent: Friday, July 15, 2016 10:13 AM
To: Wang Tim(王艇艇)
Cc: devicetree-compiler@vger.kernel.org; wtt_usst@163.com
Subject: Re: [PATCH] tests: add -a option cases

On Thu, Jul 14, 2016 at 10:02:31AM +0000, Wang Tim(王艇艇) wrote:
> Hi David,
> Thanks for your review!
> 
> I'll add the "actually check" code about the new dtb file with alignment option.
> And add more case which combine with other options.
> 
> BTW, do I need combine the test patch and "-a option" into one patch?

Either way is ok.  Since they're both fairly small, it's probably simpler to combine them.

> 
> Best Regards
> Tim Wang(王艇艇)
> 
> 
> -----Original Message-----
> From: David Gibson [mailto:david@gibson.dropbear.id.au]
> Sent: Thursday, July 14, 2016 5:27 PM
> To: Wang Tim(王艇艇)
> Cc: devicetree-compiler@vger.kernel.org; wtt_usst@163.com
> Subject: Re: [PATCH] tests: add -a option cases
> 
> On Wed, Jul 13, 2016 at 07:35:01PM +0800, Tim Wang wrote:
> > Signed-off-by: Tim Wang <timwang@asrmicro.com>
> 
> This is a good start.  However it needs some more.
> 
> First, you should have some tests which actually check that the generated blobs have the correct alignment.
> 
> Second, you should check more than just one alignment.
> 
> > ---
> >  tests/run_tests.sh | 7 ++++---
> >  1 file changed, 4 insertions(+), 3 deletions(-)
> > 
> > diff --git a/tests/run_tests.sh b/tests/run_tests.sh index
> > 7eb9b3d..6aed6d6 100755
> > --- a/tests/run_tests.sh
> > +++ b/tests/run_tests.sh
> > @@ -579,9 +579,10 @@ fdtput_tests () {
> >      dts=label01.dts
> >      dtb=$dts.fdtput.test.dtb
> >      text=lorem.txt
> > +    align=64
> >  
> >      # Allow just enough space for $text
> > -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> > +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb 
> > + $dts
> >  
> >      # run_fdtput_test <expected-result> <file> <node> <property> <flags> <value>
> >      run_fdtput_test "a_model" $dtb / model -ts "a_model"
> > @@ -600,7 +601,7 @@ fdtput_tests () {
> >      run_fdtput_test "$(cat $text $text)" $dtb /randomnode blob -ts "$(cat $text $text)"
> >  
> >      # Start again with a fresh dtb
> > -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> > +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb 
> > + $dts
> >  
> >      # Node creation
> >      run_wrap_error_test $DTPUT $dtb -c /baldrick sod @@ -628,7 
> > +629,7 @@ fdtput_tests () {
> >      run_wrap_test $DTPUT $dtb -cp /chosen/son
> >  
> >      # Start again with a fresh dtb
> > -    run_dtc_test -O dtb -p $(stat -c %s $text) -o $dtb $dts
> > +    run_dtc_test -O dtb -p $(stat -c %s $text) -a $align -o $dtb 
> > + $dts
> >  
> >      # Node delete
> >      run_wrap_test $DTPUT $dtb -c /chosen/node1 /chosen/node2
> > /chosen/node3
> 

-- 
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

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-07-18  8:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-13 11:35 [PATCH] tests: add -a option cases Tim Wang
     [not found] ` <1468409701-3310-1-git-send-email-timwang-XOWFcpiLszpWk0Htik3J/w@public.gmane.org>
2016-07-14  9:27   ` David Gibson
     [not found]     ` <20160714092721.GP14615-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-07-14 10:02       ` Wang Tim(王艇艇)
     [not found]         ` <0524d71d69d240c39c0337ea08a55d5e-w/Y+SVW4SlHx9BLjpE4ezaBKnGwkPULj@public.gmane.org>
2016-07-15  2:13           ` David Gibson
     [not found]             ` <20160715021314.GS14615-RXTfZT5YzpxwFLYp8hBm2A@public.gmane.org>
2016-07-18  8:21               ` Wang Tim(王艇艇)

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).