€•x«Œsphinx.addnodes”Œdocument”“”)�”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)�”}”(hhh]”(hŒ pending_xref”“”)�”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…”�”}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”Œ)/translations/zh_CN/dev-tools/kunit/style”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)�”}”(hhh]”hŒChinese (Traditional)”…”�”}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/zh_TW/dev-tools/kunit/style”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒItalian”…”�”}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/it_IT/dev-tools/kunit/style”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒJapanese”…”�”}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ja_JP/dev-tools/kunit/style”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒKorean”…”�”}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/ko_KR/dev-tools/kunit/style”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒPortuguese (Brazilian)”…”�”}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/pt_BR/dev-tools/kunit/style”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)�”}”(hhh]”hŒSpanish”…”�”}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”Œ)/translations/sp_SP/dev-tools/kunit/style”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)�”}”(hŒ SPDX-License-Identifier: GPL-2.0”h]”hŒ SPDX-License-Identifier: GPL-2.0”…”�”}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³ŒC/var/lib/git/docbuild/linux/Documentation/dev-tools/kunit/style.rst”h´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒTest Style and Nomenclature”h]”hŒTest Style and Nomenclature”…”�”}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)�”}”(hX_To make finding, writing, and using KUnit tests as simple as possible, it is strongly encouraged that they are named and written according to the guidelines below. While it is possible to write KUnit tests which do not follow these rules, they may break some tooling, may conflict with other tests, and may not be run automatically by testing systems.”h]”hX_To make finding, writing, and using KUnit tests as simple as possible, it is strongly encouraged that they are named and written according to the guidelines below. While it is possible to write KUnit tests which do not follow these rules, they may break some tooling, may conflict with other tests, and may not be run automatically by testing systems.”…”�”}”(hhßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÞ)�”}”(hŒCIt is recommended that you only deviate from these guidelines when:”h]”hŒCIt is recommended that you only deviate from these guidelines when:”…”�”}”(hhíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hhÊh²hubhŒenumerated_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒEPorting tests to KUnit which are already known with an existing name.”h]”hÞ)�”}”(hjh]”hŒEPorting tests to KUnit which are already known with an existing name.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhhýh²hh³hÇh´Nubj)�”}”(hŒ°Writing tests which would cause serious problems if automatically run. For example, non-deterministically producing false positives or negatives, or taking a long time to run. ”h]”hÞ)�”}”(hŒ¯Writing tests which would cause serious problems if automatically run. For example, non-deterministically producing false positives or negatives, or taking a long time to run.”h]”hŒ¯Writing tests which would cause serious problems if automatically run. For example, non-deterministically producing false positives or negatives, or taking a long time to run.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjubah}”(h]”h ]”h"]”h$]”h&]”uh1jhhýh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œarabic”Œprefix”hŒsuffix”Œ.”uh1hûhhÊh²hh³hÇh´KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒSubsystems, Suites, and Tests”h]”hŒSubsystems, Suites, and Tests”…”�”}”(hj?h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj<h²hh³hÇh´KubhÞ)�”}”(hŒôTo make tests easy to find, they are grouped into suites and subsystems. A test suite is a group of tests which test a related area of the kernel. A subsystem is a set of test suites which test different parts of a kernel subsystem or a driver.”h]”hŒôTo make tests easy to find, they are grouped into suites and subsystems. A test suite is a group of tests which test a related area of the kernel. A subsystem is a set of test suites which test different parts of a kernel subsystem or a driver.”…”�”}”(hjMh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj<h²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Subsystems”h]”hŒ Subsystems”…”�”}”(hj^h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj[h²hh³hÇh´KubhÞ)�”}”(hXÄEvery test suite must belong to a subsystem. A subsystem is a collection of one or more KUnit test suites which test the same driver or part of the kernel. A test subsystem should match a single kernel module. If the code being tested cannot be compiled as a module, in many cases the subsystem should correspond to a directory in the source tree or an entry in the ``MAINTAINERS`` file. If unsure, follow the conventions set by tests in similar areas.”h]”(hXnEvery test suite must belong to a subsystem. A subsystem is a collection of one or more KUnit test suites which test the same driver or part of the kernel. A test subsystem should match a single kernel module. If the code being tested cannot be compiled as a module, in many cases the subsystem should correspond to a directory in the source tree or an entry in the ”…”�”}”(hjlh²hh³Nh´NubhŒliteral”“”)�”}”(hŒ``MAINTAINERS``”h]”hŒ MAINTAINERS”…”�”}”(hjvh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjlubhŒG file. If unsure, follow the conventions set by tests in similar areas.”…”�”}”(hjlh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khj[h²hubhÞ)�”}”(hŒÛTest subsystems should be named after the code being tested, either after the module (wherever possible), or after the directory or files being tested. Test subsystems should be named to avoid ambiguity where necessary.”h]”hŒÛTest subsystems should be named after the code being tested, either after the module (wherever possible), or after the directory or files being tested. Test subsystems should be named to avoid ambiguity where necessary.”…”�”}”(hjŽh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K&hj[h²hubhÞ)�”}”(hXIf a test subsystem name has multiple components, they should be separated by underscores. *Do not* include "test" or "kunit" directly in the subsystem name unless we are actually testing other tests or the kunit framework itself. For example, subsystems could be called:”h]”(hŒ[If a test subsystem name has multiple components, they should be separated by underscores. ”…”�”}”(hjœh²hh³Nh´NubhŒemphasis”“”)�”}”(hŒ*Do not*”h]”hŒDo not”…”�”}”(hj¦h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1j¤hjœubhŒ´ include “testâ€� or “kunitâ€� directly in the subsystem name unless we are actually testing other tests or the kunit framework itself. For example, subsystems could be called:”…”�”}”(hjœh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K*hj[h²hubhŒdefinition_list”“”)�”}”(hhh]”(hŒdefinition_list_item”“”)�”}”(hŒ0``ext4`` Matches the module and filesystem name.”h]”(hŒterm”“”)�”}”(hŒ``ext4``”h]”ju)�”}”(hjÍh]”hŒext4”…”�”}”(hjÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjËubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉh³hÇh´K/hjÅubhŒ definition”“”)�”}”(hhh]”hÞ)�”}”(hŒ'Matches the module and filesystem name.”h]”hŒ'Matches the module and filesystem name.”…”�”}”(hjçh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K0hjäubah}”(h]”h ]”h"]”h$]”h&]”uh1jâhjÅubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÃh³hÇh´K/hjÀubjÄ)�”}”(hŒ2``apparmor`` Matches the module name and LSM name.”h]”(jÊ)�”}”(hŒ ``apparmor``”h]”ju)�”}”(hjh]”hŒapparmor”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉh³hÇh´K1hjubjã)�”}”(hhh]”hÞ)�”}”(hŒ%Matches the module name and LSM name.”h]”hŒ%Matches the module name and LSM name.”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K2hjubah}”(h]”h ]”h"]”h$]”h&]”uh1jâhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÃh³hÇh´K1hjÀh²hubjÄ)�”}”(hŒK``kasan`` Common name for the tool, prominent part of the path ``mm/kasan``”h]”(jÊ)�”}”(hŒ ``kasan``”h]”ju)�”}”(hj?h]”hŒkasan”…”�”}”(hjAh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj=ubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉh³hÇh´K3hj9ubjã)�”}”(hhh]”hÞ)�”}”(hŒACommon name for the tool, prominent part of the path ``mm/kasan``”h]”(hŒ5Common name for the tool, prominent part of the path ”…”�”}”(hjWh²hh³Nh´Nubju)�”}”(hŒ ``mm/kasan``”h]”hŒmm/kasan”…”�”}”(hj_h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjWubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K4hjTubah}”(h]”h ]”h"]”h$]”h&]”uh1jâhj9ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÃh³hÇh´K3hjÀh²hubjÄ)�”}”(hŒ‰``snd_hda_codec_hdmi`` Has several components (``snd``, ``hda``, ``codec``, ``hdmi``) separated by underscores. Matches the module name. ”h]”(jÊ)�”}”(hŒ``snd_hda_codec_hdmi``”h]”ju)�”}”(hj…h]”hŒsnd_hda_codec_hdmi”…”�”}”(hj‡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjƒubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉh³hÇh´K7hjubjã)�”}”(hhh]”hÞ)�”}”(hŒqHas several components (``snd``, ``hda``, ``codec``, ``hdmi``) separated by underscores. Matches the module name.”h]”(hŒHas several components (”…”�”}”(hj�h²hh³Nh´Nubju)�”}”(hŒ``snd``”h]”hŒsnd”…”�”}”(hj¥h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj�ubhŒ, ”…”�”}”(hj�h²hh³Nh´Nubju)�”}”(hŒ``hda``”h]”hŒhda”…”�”}”(hj·h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj�ubhŒ, ”…”�”}”hj�sbju)�”}”(hŒ ``codec``”h]”hŒcodec”…”�”}”(hjÉh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj�ubhŒ, ”…”�”}”hj�sbju)�”}”(hŒ``hdmi``”h]”hŒhdmi”…”�”}”(hjÛh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj�ubhŒ4) separated by underscores. Matches the module name.”…”�”}”(hj�h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K6hjšubah}”(h]”h ]”h"]”h$]”h&]”uh1jâhjubeh}”(h]”h ]”h"]”h$]”h&]”uh1jÃh³hÇh´K7hjÀh²hubeh}”(h]”h ]”h"]”h$]”h&]”uh1j¾hj[h²hh³hÇh´NubhÞ)�”}”(hŒ'Avoid names as shown in examples below:”h]”hŒ'Avoid names as shown in examples below:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K9hj[h²hubj¿)�”}”(hhh]”(jÄ)�”}”(hŒh``linear-ranges`` Names should use underscores, not dashes, to separate words. Prefer ``linear_ranges``.”h]”(jÊ)�”}”(hŒ``linear-ranges``”h]”ju)�”}”(hjh]”hŒ linear-ranges”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjubah}”(h]”h ]”h"]”h$]”h&]”uh1jÉh³hÇh´K_KUNIT_TEST``: where is the name of the test suite.”h]”hÞ)�”}”(hŒRbe named ``CONFIG__KUNIT_TEST``: where is the name of the test suite.”h]”(hŒ be named ”…”�”}”(hjçh²hh³Nh´Nubju)�”}”(hŒ``CONFIG__KUNIT_TEST``”h]”hŒCONFIG__KUNIT_TEST”…”�”}”(hjïh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjçubhŒ-: where is the name of the test suite.”…”�”}”(hjçh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KŸhjãubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjàh²hh³hÇh´Nubj)�”}”(hŒ�be listed either alongside the config entries for the driver/subsystem being tested, or be under [Kernel Hacking]->[Kernel Testing and Coverage]”h]”hÞ)�”}”(hŒ�be listed either alongside the config entries for the driver/subsystem being tested, or be under [Kernel Hacking]->[Kernel Testing and Coverage]”h]”hŒ�be listed either alongside the config entries for the driver/subsystem being tested, or be under [Kernel Hacking]->[Kernel Testing and Coverage]”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¡hj ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjàh²hh³hÇh´Nubj)�”}”(hŒdepend on ``CONFIG_KUNIT``.”h]”hÞ)�”}”(hj' h]”(hŒ depend on ”…”�”}”(hj) h²hh³Nh´Nubju)�”}”(hŒ``CONFIG_KUNIT``”h]”hŒ CONFIG_KUNIT”…”�”}”(hj0 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj) ubhŒ.”…”�”}”(hj) h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K£hj% ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjàh²hh³hÇh´Nubj)�”}”(hŒ=be visible only if ``CONFIG_KUNIT_ALL_TESTS`` is not enabled.”h]”hÞ)�”}”(hjP h]”(hŒbe visible only if ”…”�”}”(hjR h²hh³Nh´Nubju)�”}”(hŒ``CONFIG_KUNIT_ALL_TESTS``”h]”hŒCONFIG_KUNIT_ALL_TESTS”…”�”}”(hjY h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjR ubhŒ is not enabled.”…”�”}”(hjR h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¤hjN ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjàh²hh³hÇh´Nubj)�”}”(hŒ3have a default value of ``CONFIG_KUNIT_ALL_TESTS``.”h]”hÞ)�”}”(hjy h]”(hŒhave a default value of ”…”�”}”(hj{ h²hh³Nh´Nubju)�”}”(hŒ``CONFIG_KUNIT_ALL_TESTS``”h]”hŒCONFIG_KUNIT_ALL_TESTS”…”�”}”(hj‚ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj{ ubhŒ.”…”�”}”(hj{ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¥hjw ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjàh²hh³hÇh´Nubj)�”}”(hŒ3have a brief description of KUnit in the help text.”h]”hÞ)�”}”(hj¢ h]”hŒ3have a brief description of KUnit in the help text.”…”�”}”(hj¤ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¦hj  ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjàh²hh³hÇh´Nubj)�”}”(hŒ“depend on the feature being tested, rather than selecting it (so that enabling ``CONFIG_KUNIT_ALL_TESTS`` does not enable unrelated functionality).”h]”hÞ)�”}”(hŒ“depend on the feature being tested, rather than selecting it (so that enabling ``CONFIG_KUNIT_ALL_TESTS`` does not enable unrelated functionality).”h]”(hŒOdepend on the feature being tested, rather than selecting it (so that enabling ”…”�”}”(hj» h²hh³Nh´Nubju)�”}”(hŒ``CONFIG_KUNIT_ALL_TESTS``”h]”hŒCONFIG_KUNIT_ALL_TESTS”…”�”}”(hjà h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj» ubhŒ* does not enable unrelated functionality).”…”�”}”(hj» h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K§hj· ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjàh²hh³hÇh´Nubj)�”}”(hŒ^be ``tristate``, unless there is a specific reason that the test cannot be built as a module. ”h]”hÞ)�”}”(hŒ]be ``tristate``, unless there is a specific reason that the test cannot be built as a module.”h]”(hŒbe ”…”�”}”(hjå h²hh³Nh´Nubju)�”}”(hŒ ``tristate``”h]”hŒtristate”…”�”}”(hjí h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjå ubhŒN, unless there is a specific reason that the test cannot be built as a module.”…”�”}”(hjå h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K©hjá ubah}”(h]”h ]”h"]”h$]”h&]”uh1jhjàh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ*”uh1jÞh³hÇh´KŸhj±h²hubhÞ)�”}”(hŒ-For example, a Kconfig entry might look like:”h]”hŒ-For example, a Kconfig entry might look like:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¬hj±h²hubhŒ literal_block”“”)�”}”(hXuconfig FOO_KUNIT_TEST tristate "KUnit test for foo" if !KUNIT_ALL_TESTS depends on KUNIT default KUNIT_ALL_TESTS help This builds unit tests for foo. For more information on KUnit and unit tests in general, please refer to the KUnit documentation in Documentation/dev-tools/kunit/. If unsure, say N.”h]”hXuconfig FOO_KUNIT_TEST tristate "KUnit test for foo" if !KUNIT_ALL_TESTS depends on KUNIT default KUNIT_ALL_TESTS help This builds unit tests for foo. For more information on KUnit and unit tests in general, please refer to the KUnit documentation in Documentation/dev-tools/kunit/. If unsure, say N.”…”�”}”hj# sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒforce”‰Œlanguage”Œnone”Œhighlight_args”}”uh1j! h³hÇh´K®hj±h²hubeh}”(h]”Œtest-kconfig-entries”ah ]”h"]”Œtest kconfig entries”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K™ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒTest File and Module Names”h]”hŒTest File and Module Names”…”�”}”(hjA h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj> h²hh³hÇh´K¾ubhÞ)�”}”(hŒÿKUnit tests are often compiled as a separate module. To avoid conflicting with regular modules, KUnit modules should be named after the test suite, followed by ``_kunit`` (e.g. if "foobar" is the core module, then "foobar_kunit" is the KUnit test module).”h]”(hŒ KUnit tests are often compiled as a separate module. To avoid conflicting with regular modules, KUnit modules should be named after the test suite, followed by ”…”�”}”(hjO h²hh³Nh´Nubju)�”}”(hŒ ``_kunit``”h]”hŒ_kunit”…”�”}”(hjW h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjO ubhŒ] (e.g. if “foobarâ€� is the core module, then “foobar_kunitâ€� is the KUnit test module).”…”�”}”(hjO h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÀhj> h²hubhÞ)�”}”(hŒÑTest source files, whether compiled as a separate module or an ``#include`` in another source file, are best kept in a ``tests/`` subdirectory to not conflict with other source files (e.g. for tab-completion).”h]”(hŒ?Test source files, whether compiled as a separate module or an ”…”�”}”(hjo h²hh³Nh´Nubju)�”}”(hŒ ``#include``”h]”hŒ#include”…”�”}”(hjw h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjo ubhŒ, in another source file, are best kept in a ”…”�”}”(hjo h²hh³Nh´Nubju)�”}”(hŒ ``tests/``”h]”hŒtests/”…”�”}”(hj‰ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjo ubhŒP subdirectory to not conflict with other source files (e.g. for tab-completion).”…”�”}”(hjo h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÅhj> h²hubhÞ)�”}”(hŒ´Note that the ``_test`` suffix has also been used in some existing tests. The ``_kunit`` suffix is preferred, as it makes the distinction between KUnit and non-KUnit tests clearer.”h]”(hŒNote that the ”…”�”}”(hj¡ h²hh³Nh´Nubju)�”}”(hŒ ``_test``”h]”hŒ_test”…”�”}”(hj© h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¡ ubhŒ7 suffix has also been used in some existing tests. The ”…”�”}”(hj¡ h²hh³Nh´Nubju)�”}”(hŒ ``_kunit``”h]”hŒ_kunit”…”�”}”(hj» h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj¡ ubhŒ\ suffix is preferred, as it makes the distinction between KUnit and non-KUnit tests clearer.”…”�”}”(hj¡ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÊhj> h²hubhÞ)�”}”(hŒûSo for the common case, name the file containing the test suite ``tests/_kunit.c``. The ``tests`` directory should be placed at the same level as the code under test. For example, tests for ``lib/string.c`` live in ``lib/tests/string_kunit.c``.”h]”(hŒ@So for the common case, name the file containing the test suite ”…”�”}”(hjÓ h²hh³Nh´Nubju)�”}”(hŒ``tests/_kunit.c``”h]”hŒtests/_kunit.c”…”�”}”(hjÛ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjÓ ubhŒ. The ”…”�”}”(hjÓ h²hh³Nh´Nubju)�”}”(hŒ ``tests``”h]”hŒtests”…”�”}”(hjí h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjÓ ubhŒ] directory should be placed at the same level as the code under test. For example, tests for ”…”�”}”(hjÓ h²hh³Nh´Nubju)�”}”(hŒ``lib/string.c``”h]”hŒ lib/string.c”…”�”}”(hjÿ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjÓ ubhŒ live in ”…”�”}”(hjÓ h²hh³Nh´Nubju)�”}”(hŒ``lib/tests/string_kunit.c``”h]”hŒlib/tests/string_kunit.c”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthjÓ ubhŒ.”…”�”}”(hjÓ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÎhj> h²hubhÞ)�”}”(hŒóIf the suite name contains some or all of the name of the test's parent directory, it may make sense to modify the source filename to reduce redundancy. For example, a ``foo_firmware`` suite could be in the ``foo/tests/firmware_kunit.c`` file.”h]”(hŒªIf the suite name contains some or all of the name of the test’s parent directory, it may make sense to modify the source filename to reduce redundancy. For example, a ”…”�”}”(hj) h²hh³Nh´Nubju)�”}”(hŒ``foo_firmware``”h]”hŒ foo_firmware”…”�”}”(hj1 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj) ubhŒ suite could be in the ”…”�”}”(hj) h²hh³Nh´Nubju)�”}”(hŒ``foo/tests/firmware_kunit.c``”h]”hŒfoo/tests/firmware_kunit.c”…”�”}”(hjC h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jthj) ubhŒ file.”…”�”}”(hj) h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÓhj> h²hubeh}”(h]”Œtest-file-and-module-names”ah ]”h"]”Œtest file and module names”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K¾ubeh}”(h]”Œtest-style-and-nomenclature”ah ]”h"]”Œtest style and nomenclature”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)�”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jŽ Œerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jh je j®j«jOjLjVjSj¦j£j; j8 j` j] uŒ nametypes”}”(jh ‰j®‰jO‰jV‰j¦‰j; ‰j` ‰uh}”(je hÊj«j<jLj[jSjRj£jYj8 j±j] j> uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.