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

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

Will fix.


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


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

--
To unsubscribe from this list: send the line "unsubscribe devicetree-compiler" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[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