app/test: introduce resources for tests
authorJan Viktorin <viktorin@rehivetech.com>
Mon, 13 Jun 2016 15:07:36 +0000 (17:07 +0200)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Mon, 13 Jun 2016 18:56:42 +0000 (20:56 +0200)
commitfe6923cbfd7619e6650e8f5ae6bbbc949273059b
tree07e36d7213868cbfe9b61146f52ace82644ee307
parent99d6231fdca76d260b2ed8d0ec1b0578e237d63b
app/test: introduce resources for tests

Certain internal mechanisms of DPDK access different file system
structures (e.g. /sys/bus/pci/devices). It is difficult to test
those cases automatically by a unit test when such path is not
hard-coded and there is no simple way how to distribute fake ones
with the current testing environment.

This patch adds a possibility to declare a resource embedded in
the test binary itself. The structure resource cover the generic
situation - it provides a name for lookup and pointers to the
embedded data blob. A resource is registered in a constructor by
the macro REGISTER_RESOURCE.

Some initial tests of simple resources is included and added into
the group_1.

Signed-off-by: Jan Viktorin <viktorin@rehivetech.com>
MAINTAINERS
app/test/Makefile
app/test/autotest_data.py
app/test/resource.c [new file with mode: 0644]
app/test/resource.h [new file with mode: 0644]
app/test/test_resource.c [new file with mode: 0644]