linux/Documentation/dev-tools
Daniel Latypov 61695f8c5d kunit: split resource API from test.h into new resource.h
Background:
Currently, a reader looking at kunit/test.h will find the file is quite
long, and the first meaty comment is a doc comment about struct
kunit_resource.

Most users will not ever use the KUnit resource API directly.
They'll use kunit_kmalloc() and friends, or decide it's simpler to do
cleanups via labels (it often can be) instead of figuring out how to use
the API.

It's also logically separate from everything else in test.h.
Removing it from the file doesn't cause any compilation errors (since
struct kunit has `struct list_head resources` to store them).

This commit:
Let's move it into a kunit/resource.h file and give it a separate page
in the docs, kunit/api/resource.rst.

We include resource.h at the bottom of test.h since
* don't want to force existing users to add a new include if they use the API
* it accesses `lock` inside `struct kunit` in a inline func
  * so we can't just forward declare, and the alternatives require
    uninlining the func, adding hepers to lock/unlock, or other more
    invasive changes.

Now the first big comment in test.h is about kunit_case, which is a lot
more relevant to what a new user wants to know.

A side effect of this is git blame won't properly track history by
default, users need to run
$ git blame -L ,1 -C17 include/kunit/resource.h

Signed-off-by: Daniel Latypov <dlatypov@google.com>
Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2022-04-04 16:23:08 -06:00
..
kunit kunit: split resource API from test.h into new resource.h 2022-04-04 16:23:08 -06:00
checkpatch.rst Revert "docs: checkpatch: add UNNECESSARY/UNSPECIFIED_INT and UNNECESSARY_ELSE" 2021-10-04 17:13:53 -06:00
coccinelle.rst Documentation: Coccinelle: Improve command example for debugging patches 2020-12-03 15:45:18 -07:00
gcov.rst docs/gcov: Convert two tags to ref in dev-tools/gov.rst 2021-04-08 11:19:43 -06:00
gdb-kernel-debugging.rst scripts/gdb: add lx_current support for arm64 2021-05-07 00:26:33 -07:00
index.rst Documentation: dev-tools: Add KTAP specification 2021-12-10 14:37:35 -07:00
kasan.rst kasan: documentation updates 2022-03-24 19:06:48 -07:00
kcov.rst Documentation/kcov: define `ip' in the example 2021-11-09 10:02:52 -08:00
kcsan.rst kcsan: Document modeling of weak memory 2021-12-09 16:42:27 -08:00
kfence.rst kfence: allow use of a deferrable timer 2022-03-22 15:57:11 -07:00
kgdb.rst Documentation: kgdb: Replace deprecated remotebaud 2022-01-07 09:33:13 -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 docs/kselftest: clarify running mainline tests on stables 2022-01-27 10:56:09 -07:00
ktap.rst Docs: ktap: add code-block type 2022-03-11 14:12:27 -07:00
sparse.rst Documentation/sparse: add hints about __CHECKER__ 2022-03-23 19:00:33 -07:00
testing-overview.rst docs: dev-tools: testing-overview.rst: avoid using ReST :doc:foo markup 2021-06-17 13:24:37 -06:00
ubsan.rst ubsan: remove UBSAN_MISC in favor of individual options 2020-12-15 22:46:19 -08:00