[Skiboot] [PATCH 0/4] core/device.c tests

Michael Ellerman mpe at ellerman.id.au
Fri Feb 27 16:36:44 AEDT 2015


On Fri, 2015-02-27 at 16:06 +1100, Daniel Axtens wrote:
> This vastly increases test coverage on core/device.c
> 
> The major remaining hole in coverage of device.c is the set of
> functions that expand out a flattened device tree. I considered two
> approaches for these:
> 
>  1) Include a binary fdt blob and check it expands properly.
>  2) Pull in the functions in core/fdt.c to flatten a programmatically
>     created tree, then verify that expand(flatten(tree)) == tree.
>  
> Approach 1 seems ugly, and approach 2 requires pulling in core/fdt.c,

Actually I'd argue 1 is the right approach. In fact arguably there should be
several dtbs, representative of what you actually get in practice. That way if
you ever break parsing you'll notice via the test suite, rather than when you
happen to boot on that obscure machine.

cheers




More information about the Skiboot mailing list