<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/Documentation/dev-tools/kunit, branch v6.6.132</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6.132'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2023-07-26T19:29:46+00:00</updated>
<entry>
<title>kunit: Add documentation of KUnit test attributes</title>
<updated>2023-07-26T19:29:46+00:00</updated>
<author>
<name>Rae Moar</name>
<email>rmoar@google.com</email>
</author>
<published>2023-07-25T21:25:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e588586675f62b710fcc2d7bc6ea3ea8353e055d'/>
<id>urn:sha1:e588586675f62b710fcc2d7bc6ea3ea8353e055d</id>
<content type='text'>
Add documentation on the use of test attributes under the section "Tips for
Running KUnit Tests" in the KUnit docs.

Documentation includes three sections on how to mark tests with attributes,
how attributes are reported, and how the user can filter tests using test
attributes.

Add descriptions of new flags to list of command-line arguments.

Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Rae Moar &lt;rmoar@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Documentation: kunit: Rename references to kunit_abort()</title>
<updated>2023-06-06T14:57:37+00:00</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2023-06-02T03:53:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fefdb43943c1a0d87e1b43ae4d03e5f9a1d058f4'/>
<id>urn:sha1:fefdb43943c1a0d87e1b43ae4d03e5f9a1d058f4</id>
<content type='text'>
The kunit_abort() function has been renamed __kunit_abort(), update the
references to it in the documentation.

Suggested-by: Daniel Latypov &lt;dlatypov@google.com&gt;
Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Reviewed-by: Daniel Latypov &lt;dlatypov@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Documentation: Kunit: add MODULE_LICENSE to sample code</title>
<updated>2023-05-31T18:42:40+00:00</updated>
<author>
<name>Takashi Sakamoto</name>
<email>o-takashi@sakamocchi.jp</email>
</author>
<published>2023-05-30T10:52:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=6543960cd3bdb9fabdd0567ab02f4d1168ee96d9'/>
<id>urn:sha1:6543960cd3bdb9fabdd0567ab02f4d1168ee96d9</id>
<content type='text'>
The sample code has Kconfig for tristate configuration. In the case, it
could be friendly to developers that the code has MODULE_LICENSE, since
the missing MODULE_LICENSE brings error to modpost when the code is built
as loadable kernel module.

Signed-off-by: Takashi Sakamoto &lt;o-takashi@sakamocchi.jp&gt;
Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Documentation: kunit: Add usage notes for kunit_add_action()</title>
<updated>2023-05-25T14:53:12+00:00</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2023-05-25T04:21:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c7853b55116e644e1fd4f0e5d8ea7c5dc89d71b8'/>
<id>urn:sha1:c7853b55116e644e1fd4f0e5d8ea7c5dc89d71b8</id>
<content type='text'>
Add some basic documentation for kunit_add_action() and related
deferred action functions.

Reviewed-by: Rae Moar &lt;rmoar@google.com&gt;
Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Documentation: kunit: Warn that exit functions run even if init fails</title>
<updated>2023-05-12T00:17:35+00:00</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2023-05-10T05:38:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cdc87bda607518e70b6a6745cd593458d725b5a7'/>
<id>urn:sha1:cdc87bda607518e70b6a6745cd593458d725b5a7</id>
<content type='text'>
KUnit's exit functions will run even if the corresponding init function
fails. It's easy, when writing an exit function, to assume the init
function succeeded, and (for example) access uninitialised memory or
dereference NULL pointers.

Note that this case exists and should be handled in the documentation.

Suggested-by: Benjamin Berg &lt;benjamin@sipsolutions.net&gt;
Link: https://lore.kernel.org/linux-kselftest/a39af0400abedb2e9b31d84c37551cecc3eed0e1.camel@sipsolutions.net/
Reviewed-by: Sadiya Kazi &lt;sadiyakazi@google.com&gt;
Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Documentation: kunit: Note that assertions should not be used in cleanup</title>
<updated>2023-05-12T00:17:29+00:00</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2023-05-10T05:38:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=410f07492eaef600fe817eef9fd272f6692a451a'/>
<id>urn:sha1:410f07492eaef600fe817eef9fd272f6692a451a</id>
<content type='text'>
As assertions abort the test cleanup process, they should be avoided
from within a suite's exit function, or from within resource 'free'
functions. Unlike with initialisation or main test execution, no further
cleanup will be performed after a failed assertion, potentially causing
a leak of resources.

Reviewed-by: Sadiya Kazi &lt;sadiyakazi@google.com&gt;
Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Documentation: kunit: Modular tests should not depend on KUNIT=y</title>
<updated>2023-05-08T14:39:49+00:00</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2023-05-02T10:06:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=78227fa03c6854e8ca23911309c763d909653c6e'/>
<id>urn:sha1:78227fa03c6854e8ca23911309c763d909653c6e</id>
<content type='text'>
When the documentation was updated for modular tests, the dependency on
"KUNIT=y" was forgotten to be updated, now encouraging people to create
tests that cannot be enabled when the KUNIT framework itself is modular.
Fix this by changing the dependency to "KUNIT".

Document when it is appropriate (and required) to depend on "KUNIT=y".

Fixes: c9ef2d3e3f3b ("KUnit: Docs: make start.rst example Kconfig follow style.rst")
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Documentation: Add Function Redirection API docs</title>
<updated>2023-02-08T21:28:17+00:00</updated>
<author>
<name>Sadiya Kazi</name>
<email>sadiyakazi@google.com</email>
</author>
<published>2023-01-31T06:46:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9ecc9cdd168e217a42b382468643dde66dfac309'/>
<id>urn:sha1:9ecc9cdd168e217a42b382468643dde66dfac309</id>
<content type='text'>
Added a new page (functionredirection.rst) that describes the Function
Redirection (static stubbing) API. This page will be expanded if we add,
for example, ftrace-based stubbing.

In addition,
1. Updated the api/index.rst page to create an entry for function
   redirection api
2. Updated the toctree to be hidden, reducing redundancy on the
   generated page.

Signed-off-by: Sadiya Kazi &lt;sadiyakazi@google.com&gt;
Co-developed-by: Daniel Latypov &lt;dlatypov@google.com&gt;
Signed-off-by: Daniel Latypov &lt;dlatypov@google.com&gt;
Co-developed-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>kunit: Add "hooks" to call into KUnit when it's built as a module</title>
<updated>2023-02-08T21:26:25+00:00</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2023-01-28T07:10:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7170b7ed6acbde523c5d362c8978c60df4c30f30'/>
<id>urn:sha1:7170b7ed6acbde523c5d362c8978c60df4c30f30</id>
<content type='text'>
KUnit has several macros and functions intended for use from non-test
code. These hooks, currently the kunit_get_current_test() and
kunit_fail_current_test() macros, didn't work when CONFIG_KUNIT=m.

In order to support this case, the required functions and static data
need to be available unconditionally, even when KUnit itself is not
built-in. The new 'hooks.c' file is therefore always included, and has
both the static key required for kunit_get_current_test(), and a table
of function pointers in struct kunit_hooks_table. This is filled in with
the real implementations by kunit_install_hooks(), which is kept in
hooks-impl.h and called when the kunit module is loaded.

This can  be extended for future features which require similar
"hook" behaviour, such as static stubs, by simply adding new entries to
the struct, and the appropriate code to set them.

Fixed white-space errors during commit:
Shuah Khan &lt;skhan@linuxfoundation.org&gt;

Resolved merge conflicts with:
db105c37a4d6 ("kunit: Export kunit_running()")
This patch supersedes the above.
Shuah Khan &lt;skhan@linuxfoundation.org&gt;

Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Reviewed-by: Rae Moar &lt;rmoar@google.com&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Documentation: kunit: Fix "How Do I Use This" / "Next Steps" sections</title>
<updated>2022-12-12T21:13:48+00:00</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2022-12-07T04:33:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=a81fe7ecf717e5ae16892c282378ca380d4e99c9'/>
<id>urn:sha1:a81fe7ecf717e5ae16892c282378ca380d4e99c9</id>
<content type='text'>
The "How Do I Use This" section of index.rst and "Next Steps" section of
start.rst were just copies of the table of contents, and therefore
weren't really useful either when looking a sphinx generated output
(which already had the TOC visible) or when reading the source (where
it's just a list of files that ls could give you).

Instead, provide a small number of concrete next steps, and a bit more
description about what the pages contain.

This also removes the broken reference to 'tips.rst', which was
previously removed.

Fixed git am whitespace complaints during commit:
Shuah Khan &lt;skhan@linuxfoundation.org&gt;

Fixes: 4399c737a97d ("Documentation: kunit: Remove redundant 'tips.rst' page")
Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Reviewed-by: Sadiya Kazi &lt;sadiyakazi@google.com&gt;
Reviewed-by: Bagas Sanjaya &lt;bagasdotme@gmail.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
</feed>
