linux/Documentation/dev-tools
Daniel Latypov de2fcb3e62 Documentation: kunit: add tips for using current->kunit_test
As of commit 359a376081 ("kunit: support failure from dynamic analysis
tools"), we can use current->kunit_test to find the current kunit test.

Mention this in tips.rst and give an example of how this can be used in
conjunction with `test->priv` to pass around state and specifically
implement something like mocking.
There's a lot more we could go into on that topic, but given that
example is already longer than every other "tip" on this page, we just
point to the API docs and leave filling in the blanks as an exercise to
the reader.

Also give an example of kunit_fail_current_test().

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2021-04-07 16:40:37 -06:00
..
kunit Documentation: kunit: add tips for using current->kunit_test 2021-04-07 16:40:37 -06:00
coccinelle.rst Documentation: Coccinelle: Improve command example for debugging patches 2020-12-03 15:45:18 -07:00
gcov.rst docs: gcov: replace links with HTTPS 2020-07-13 11:29:16 -06:00
gdb-kernel-debugging.rst Replace HTTP links with HTTPS ones: documentation 2020-06-08 09:30:19 -06:00
index.rst kfence, Documentation: add KFENCE documentation 2021-02-26 09:41:02 -08:00
kasan.rst kasan: clarify that only first bug is reported in HW_TAGS 2021-02-26 09:41:03 -08:00
kcov.rst Documentation: fix typos found in process, dev-tools, and doc-guide subdirectories 2020-12-03 15:55:04 -07:00
kcsan.rst kcsan: Re-add GCC as a supported compiler 2020-06-29 12:04:48 -07:00
kfence.rst kfence: report sensitive information based on no_hash_pointers 2021-02-26 09:41:02 -08:00
kgdb.rst Documentation: kgdb: Fix a typo 2020-11-18 13:47:17 -07:00
kmemleak.rst mm,kmemleak-test.c: move kmemleak-test.c to samples dir 2020-10-13 18:38:27 -07:00
kselftest.rst doc: dev-tools: kselftest.rst: Update examples and paths 2020-10-07 07:59:24 -06:00
sparse.rst doc: add link to sparse's home page/internal docs 2020-07-05 14:32:56 -06:00
ubsan.rst ubsan: remove UBSAN_MISC in favor of individual options 2020-12-15 22:46:19 -08:00