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

Daniel Axtens dja at axtens.net
Fri Feb 27 16:06:31 AEDT 2015


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! :)

Daniel Axtens (4):
  core/test: Test that device paths/names function as expected.
  core/test: Use "" as the name of the device tree root node.
  core/test: Test more get/set functions in device.c
  core/test: Test compatible, chip id and phandle related DT functions

 core/test/run-device.c | 191 +++++++++++++++++++++++++++++++++++++++++++++++--
 1 file changed, 187 insertions(+), 4 deletions(-)

-- 
2.1.4



More information about the Skiboot mailing list