<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/Documentation/dev-tools/kunit, branch v5.11</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.11</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.11'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-01-16T00:47:39Z</updated>
<entry>
<title>Documentation: kunit: include example of a parameterized test</title>
<updated>2021-01-16T00:47:39Z</updated>
<author>
<name>Daniel Latypov</name>
<email>dlatypov@google.com</email>
</author>
<published>2020-12-16T00:22:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8db50be262e9faf59fa0feb74599c29b64eb0af2'/>
<id>urn:sha1:8db50be262e9faf59fa0feb74599c29b64eb0af2</id>
<content type='text'>
Commit fadb08e7c750 ("kunit: Support for Parameterized Testing")
introduced support but lacks documentation for how to use it.

This patch builds on commit 1f0e943df68a ("Documentation: kunit: provide
guidance for testing many inputs") to show a minimal example of the new
feature.

Signed-off-by: Daniel Latypov &lt;dlatypov@google.com&gt;
Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Tested-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Acked-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Documentation: kunit: provide guidance for testing many inputs</title>
<updated>2020-12-01T22:30:06Z</updated>
<author>
<name>Daniel Latypov</name>
<email>dlatypov@google.com</email>
</author>
<published>2020-11-23T22:57:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1f0e943df68ab407f523d9f47d96a535686a2293'/>
<id>urn:sha1:1f0e943df68ab407f523d9f47d96a535686a2293</id>
<content type='text'>
usage.rst goes into a detailed section about faking out classes, but
currently lacks wording about how one might idiomatically test a range
of inputs.

Add a new chapter for "Common Patterns" and group "Isolating behvaior"
and this new section under there.

Give an example of how one might test a hash function via macros/helper
funcs and a table-driven test and very briefly discuss pros and cons.

Also highlight the KUNIT_EXPECT_*_MSG() variants (that aren't mentioned
elsewhere [1]) which are particularly useful in these situations.

It is also criminally underused at the moment, only appearing in 2
tests (both written by people involved in KUnit).

[1] not even on
https://www.kernel.org/doc/html/latest/dev-tools/kunit/api/test.html

Signed-off-by: Daniel Latypov &lt;dlatypov@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: Docs: usage: wording fixes</title>
<updated>2020-11-10T20:40:30Z</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2020-10-28T17:43:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=873ddeb881e055fb0c4e371cc3a006bfd9388f00'/>
<id>urn:sha1:873ddeb881e055fb0c4e371cc3a006bfd9388f00</id>
<content type='text'>
Fix minor grammar and punctutation glitches.
Hyphenate "architecture-specific" instances.

Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: David Gow &lt;davidgow@google.com&gt;
Cc: linux-kselftest@vger.kernel.org
Cc: kunit-dev@googlegroups.com
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Cc: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Cc: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>KUnit: Docs: style: fix some Kconfig example issues</title>
<updated>2020-11-10T20:39:26Z</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2020-10-28T17:42:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1f4dde57125b3d91b900e82ac33a196312be5c8e'/>
<id>urn:sha1:1f4dde57125b3d91b900e82ac33a196312be5c8e</id>
<content type='text'>
Fix the Kconfig example to be closer to Kconfig coding style.

Also add punctuation and a trailing slash ('/') to a sub-directory
name -- this is how the text mostly appears in other Kconfig files.

Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: David Gow &lt;davidgow@google.com&gt;
Cc: linux-kselftest@vger.kernel.org
Cc: kunit-dev@googlegroups.com
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Cc: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Cc: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Reviewed-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>KUnit: Docs: fix a wording typo</title>
<updated>2020-11-10T20:36:36Z</updated>
<author>
<name>Randy Dunlap</name>
<email>rdunlap@infradead.org</email>
</author>
<published>2020-10-27T18:48:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f7766424cf15fd6e03e8230fb17d5612c5b76dbe'/>
<id>urn:sha1:f7766424cf15fd6e03e8230fb17d5612c5b76dbe</id>
<content type='text'>
Fix a wording typo (keyboard glitch).

Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: David Gow &lt;davidgow@google.com&gt;
Cc: linux-kselftest@vger.kernel.org
Cc: kunit-dev@googlegroups.com
Cc: Shuah Khan &lt;shuah@kernel.org&gt;
Cc: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Cc: Brendan Higgins &lt;brendanhiggins@google.com&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: Update Kconfig parts for KUNIT's module support</title>
<updated>2020-10-26T19:24:46Z</updated>
<author>
<name>SeongJae Park</name>
<email>sjpark@amazon.de</email>
</author>
<published>2020-10-21T19:25:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f0b62039bf7f998fb3f1369ac70dbe571c74f9d8'/>
<id>urn:sha1:f0b62039bf7f998fb3f1369ac70dbe571c74f9d8</id>
<content type='text'>
If 'CONFIG_KUNIT=m', letting kunit tests that do not support loadable
module build depends on 'KUNIT' instead of 'KUNIT=y' result in compile
errors.  This commit updates the document for this.

Fixes: 9fe124bf1b77 ("kunit: allow kunit to be loaded as a module")
Signed-off-by: SeongJae Park &lt;sjpark@amazon.de&gt;
Reviewed-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>Documentation: kunit: add a brief blurb about kunit_test_suite</title>
<updated>2020-10-09T20:37:55Z</updated>
<author>
<name>Brendan Higgins</name>
<email>brendanhiggins@google.com</email>
</author>
<published>2020-08-04T20:47:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a82763e63ee78c9876211998d0bcc082f4ff63d8'/>
<id>urn:sha1:a82763e63ee78c9876211998d0bcc082f4ff63d8</id>
<content type='text'>
Add a brief blurb saying how and when the kunit_test_suite() macro
works to the usage documentation.

Signed-off-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@kernel.org&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Documentation: kunit: Add naming guidelines</title>
<updated>2020-10-09T20:33:17Z</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2020-09-11T04:24:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2a41fc52c21b6ece49921716bd289bfebaadcc04'/>
<id>urn:sha1:2a41fc52c21b6ece49921716bd289bfebaadcc04</id>
<content type='text'>
As discussed in [1], KUnit tests have hitherto not had a particularly
consistent naming scheme. This adds documentation outlining how tests
and test suites should be named, including how those names should be
used in Kconfig entries and filenames.

[1]:
https://lore.kernel.org/linux-kselftest/202006141005.BA19A9D3@keescook/t/#u

Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Brendan Higgins &lt;brendanhiggins@google.com&gt;
Reviewed-by: Marco Elver &lt;elver@google.com&gt;
Reviewed-by: Tim Bird &lt;tim.bird@sony.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'linux-kselftest-kunit-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest</title>
<updated>2020-08-05T17:07:39Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-08-05T17:07:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=53e5504bdbdb16548e39a4834c97742693964197'/>
<id>urn:sha1:53e5504bdbdb16548e39a4834c97742693964197</id>
<content type='text'>
Pull kunit updates from Shuah Khan:

 - Add a generic kunit_resource API extending it to support resources
   that are passed in to kunit in addition kunit allocated resources. In
   addition, KUnit resources are now refcounted to avoid passed in
   resources being released while in use by kunit.

 - Add support for named resources.

 - Important bug fixes from Brendan Higgins and Will Chen

* tag 'linux-kselftest-kunit-5.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  kunit: tool: fix improper treatment of file location
  kunit: tool: fix broken default args in unit tests
  kunit: capture stderr on all make subprocess calls
  Documentation: kunit: Remove references to --defconfig
  kunit: add support for named resources
  kunit: generalize kunit_resource API beyond allocated resources
</content>
</entry>
<entry>
<title>Documentation: kunit: Remove references to --defconfig</title>
<updated>2020-07-17T20:08:43Z</updated>
<author>
<name>David Gow</name>
<email>davidgow@google.com</email>
</author>
<published>2020-07-07T04:31:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=39f65da0920349deb2be14bf8c83490b8775e5d3'/>
<id>urn:sha1:39f65da0920349deb2be14bf8c83490b8775e5d3</id>
<content type='text'>
The --defconfig option in kunit_tool was removed in [1], but the getting
started and kunit_tool documentation still encouraged its use. Update
those documents to reflect that it's no-longer required, and is the
default behaviour if no .kunitconfig is found.

Also update a couple of places where .kunitconfig is still referred to
as kunitconfig (this was changed in [2]).

[1]:
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit-fixes&amp;id=9bdf64b35117cc10813d24e1842cd8ee40ecbf19
[2]:
https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit-fixes&amp;id=14ee5cfd4512ee3d1e0047d8751450dcc6544070

Signed-off-by: David Gow &lt;davidgow@google.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
</feed>
