mirror of https://gitee.com/openkylin/linux.git
359a376081
Add a kunit_fail_current_test() function to fail the currently running
test, if any, with an error message.
This is largely intended for dynamic analysis tools like UBSAN and for
fakes.
E.g. say I had a fake ops struct for testing and I wanted my `free`
function to complain if it was called with an invalid argument, or
caught a double-free. Most return void and have no normal means of
signalling failure (e.g. super_operations, iommu_ops, etc.).
Key points:
* Always update current->kunit_test so anyone can use it.
* commit
|
||
---|---|---|
.. | ||
.kunitconfig | ||
Kconfig | ||
Makefile | ||
assert.c | ||
debugfs.c | ||
debugfs.h | ||
executor.c | ||
kunit-example-test.c | ||
kunit-test.c | ||
string-stream-test.c | ||
string-stream.c | ||
string-stream.h | ||
test.c | ||
try-catch-impl.h | ||
try-catch.c |