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

Stewart Smith stewart at linux.vnet.ibm.com
Mon Mar 2 14:09:00 AEDT 2015


Daniel Axtens <dja at axtens.net> writes:

> 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,
> which requires libftd/fdt_sw.c, which pulls in mem_region-malloc.h,
> which has with a definition of zalloc that conflicts with the stub in
> run-device.c.
>
> I'm going to attack other low-hanging fruit before I come back to
> this. In the mean time, suggestions for better approaches are welcome!
> :)

Maybe have a different test for it, everything doesn't have to fit in
the one source file.

I kind of like the approach of doing both 1 and 2. where 1 is a saved
copy of what's generated by 2 - that way we're also testing that we
didn't just change the serialized format by accident (which would mean
that test 2 would pass but would possibly break something in the field).



More information about the Skiboot mailing list