Re: [RFC PATCH v2 2/3] dtc: make check test for dtc --annotate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Mon, Sep 21, 2015 at 10:38:27PM -0700, Frank Rowand wrote:
> From: Frank Rowand <frank.rowand@xxxxxxxxxxxxxx>
> 
> Add dtc tests.
> 
>   - dtc --annotate to create a .dts with annotations
>   - compile the annotated .dts
>   - compare the .dts created from include0.dts to the .dts created
>     by first compiling include0.dts with annotations, then compiling
>     the resulting .dts without --annotations to strip the annotation

My brain hurts trying to follow that.

> Not-signed-off-by: Frank Rowand <frank.rowand@xxxxxxxxxxxxxx>
> ---
>  tests/run_tests.sh |   10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> Index: b/tests/run_tests.sh
> ===================================================================
> --- a/tests/run_tests.sh
> +++ b/tests/run_tests.sh
> @@ -276,6 +276,16 @@ libfdt_tests () {
>      run_dtc_test -I dts -O dtb -o sourceoutput.test.dts.test.dtb sourceoutput.test.dts
>      run_test dtbs_equal_ordered sourceoutput.test.dtb sourceoutput.test.dts.test.dtb
>  
> +    # verify annotated .dts can be compiled
> +    run_dtc_test --annotate -o sourceoutput.test.annotate.dts sourceoutput.dts

1) Looks like you forgot to git add sourceoutput.dts
2) All your generated files should be named *.test.dts, so that make
clean will get rid of them.

> +    run_dtc_test -o sourceoutput.test.annotate.dts.test.dts sourceoutput.test.annotate.dts
> +
> +    # verify annotated .dts can be stripped to match non-annotated
> +    run_dtc_test -o includes.dts include0.dts
> +    run_dtc_test --annotate -o includes.annotate.dts include0.dts
> +    run_dtc_test -o includes.annotate_undo.dts includes.annotate.dts
> +    run_wrap_test cmp includes.dts includes.annotate_undo.dts

So, this checks that annotate doesn't break the semantic parts of the
tree, which is a good test.

But I was suggesting a canned example, including the annotations to
check for regressions in the annotation generation itself.

>      run_dtc_test -I dts -O dtb -o embedded_nul.test.dtb embedded_nul.dts
>      run_dtc_test -I dts -O dtb -o embedded_nul_equiv.test.dtb embedded_nul_equiv.dts
>      run_test dtbs_equal_ordered embedded_nul.test.dtb embedded_nul_equiv.test.dtb

-- 
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: pgpEp1bLcanEd.pgp
Description: PGP signature


[Index of Archives]     [Device Tree]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux