The source for the Linux kernel used in Windows Subsystem for Linux 2 (WSL2)
Перейти к файлу
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
Documentation Documentation: kunit: add tips for using current->kunit_test 2021-04-07 16:40:37 -06:00
LICENSES
arch * Doc fixes 2021-03-04 11:26:17 -08:00
block
certs
crypto
drivers RDMA 5.12 first rc pull request 2021-03-05 17:27:59 -08:00
fs pstore fixes for v5.12-rc2 2021-03-05 17:21:25 -08:00
include kunit: fix -Wunused-function warning for __kunit_fail_current_test 2021-04-06 15:22:39 -06:00
init
ipc
kernel io_uring-5.12-2021-03-05 2021-03-05 12:44:43 -08:00
lib kunit: support failure from dynamic analysis tools 2021-04-02 14:19:58 -06:00
mm
net
samples
scripts gcc-plugins fixes for v5.12-rc2 2021-03-05 17:23:03 -08:00
security
sound ALSA: hda/realtek: Apply dual codec quirks for MSI Godlike X570 board 2021-03-03 15:25:03 +01:00
tools kunit: tool: make --kunitconfig accept dirs, add lib/kunit fragment 2021-04-02 14:14:36 -06:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile Linux 5.12-rc2 2021-03-05 17:33:41 -08:00
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.