> For the complete documentation index, see [llms.txt](https://richardweiyang-2.gitbook.io/kernel-exploring/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://richardweiyang-2.gitbook.io/kernel-exploring/handy_tools/03-selftest.md).

# selftest

内核中专门做功能测试的单元叫selftest。在内核目录的tools/testing/selftests目录下。

在这一部分我们花点时间研究一下。

[测试用例的构造过程](/kernel-exploring/handy_tools/03-selftest/03_01-build.md)

[编写测试](/kernel-exploring/handy_tools/03-selftest/03_02-write_test.md)
