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 Tue, Sep 22, 2015 at 10:21:55AM -0700, Frank Rowand wrote:
> On 9/22/2015 3:39 AM, David Gibson wrote:
> > 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
> 
> sourceoutput.dts is an existing .dts that I used again.  But it looks like a bad
> choice - I think I should just use include0.dts, as you suggested.

Ok.

> > 2) All your generated files should be named *.test.dts, so that make
> > clean will get rid of them.
> 
> Will fix.

Ok.

> >> +    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.
> 
> OK, I think I understand now.  Add a test to make sure that the annotation is
> correct.  This will be interesting because the source path in the annotation
> is an absolute path, including the location of the dtc git repository.  The
> way that I strip off the location of the dtc git repository in my personal
> world is a bit ugly.  I'll think about how to do this.

Hm, yeah.  I thought we only stored relative paths internally, unless
absolute ones were supplied - but looking at srcpos.c I'm not so
sure.  The file path stuff is actually pretty hard to follow.

If we are using relative paths everywhere, we should maybe stop that -
although it might make the relative open stuff harder :/

-- 
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: pgpFV1JQOZwR6.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