linux/lib/kunit
Alan Maguire 725aca9585 kunit: add support for named resources
The kunit resources API allows for custom initialization and
cleanup code (init/fini); here a new resource add function sets
the "struct kunit_resource" "name" field, and calls the standard
add function.  Having a simple way to name resources is
useful in cases such as multithreaded tests where a set of
resources are shared among threads; a pointer to the
"struct kunit *" test state then is all that is needed to
retrieve and use named resources.  Support is provided to add,
find and destroy named resources; the latter two are simply
wrappers that use a "match-by-name" callback.

If an attempt to add a resource with a name that already exists
is made kunit_add_named_resource() will return -EEXIST.

Signed-off-by: Alan Maguire <alan.maguire@oracle.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2020-06-26 14:12:00 -06:00
..
assert.c
debugfs.c
debugfs.h
Kconfig kunit: default KUNIT_* fragments to KUNIT_ALL_TESTS 2020-06-01 14:23:25 -06:00
kunit-example-test.c
kunit-test.c kunit: add support for named resources 2020-06-26 14:12:00 -06:00
Makefile
string-stream-test.c
string-stream.c kunit: generalize kunit_resource API beyond allocated resources 2020-06-26 14:12:00 -06:00
string-stream.h
test.c kunit: add support for named resources 2020-06-26 14:12:00 -06:00
try-catch-impl.h
try-catch.c