€•w»Œ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/start”Œ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/start”Œ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/start”Œ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/start”Œ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/start”Œ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/start”Œ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/start”Œ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/start.rst”h´KubhŒsection”“”)�”}”(hhh]”(hŒtitle”“”)�”}”(hŒGetting Started”h]”hŒGetting Started”…”�”}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)�”}”(hŒÝThis page contains an overview of the kunit_tool and KUnit framework, teaching how to run existing tests and then how to write a simple test case, and covers common problems users face when using KUnit for the first time.”h]”hŒÝThis page contains an overview of the kunit_tool and KUnit framework, teaching how to run existing tests and then how to write a simple test case, and covers common problems users face when using KUnit for the first time.”…”�”}”(hhßh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒInstalling Dependencies”h]”hŒInstalling Dependencies”…”�”}”(hhðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhíh²hh³hÇh´K ubhÞ)�”}”(hŒlKUnit has the same dependencies as the Linux kernel. As long as you can build the kernel, you can run KUnit.”h]”hŒlKUnit has the same dependencies as the Linux kernel. As long as you can build the kernel, you can run KUnit.”…”�”}”(hhþh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K hhíh²hubeh}”(h]”Œinstalling-dependencies”ah ]”h"]”Œinstalling dependencies”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒRunning tests with kunit_tool”h]”hŒRunning tests with kunit_tool”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´KubhÞ)�”}”(hŒ¢kunit_tool is a Python script, which configures and builds a kernel, runs tests, and formats the test results. From the kernel repository, you can run kunit_tool:”h]”hŒ¢kunit_tool is a Python script, which configures and builds a kernel, runs tests, and formats the test results. From the kernel repository, you can run kunit_tool:”…”�”}”(hj%h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjh²hubhŒ literal_block”“”)�”}”(hŒ"./tools/testing/kunit/kunit.py run”h]”hŒ"./tools/testing/kunit/kunit.py run”…”�”}”hj5sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒforce”‰Œlanguage”Œbash”Œhighlight_args”}”uh1j3h³hÇh´Khjh²hubhŒnote”“”)�”}”(hXÚYou may see the following error: "The source tree is not clean, please run 'make ARCH=um mrproper'" This happens because internally kunit.py specifies ``.kunit`` (default option) as the build directory in the command ``make O=output/dir`` through the argument ``--build_dir``. Hence, before starting an out-of-tree build, the source tree must be clean. There is also the same caveat mentioned in the "Build directory for the kernel" section of the :doc:`admin-guide `, that is, its use, it must be used for all invocations of ``make``. The good news is that it can indeed be solved by running ``make ARCH=um mrproper``, just be aware that this will delete the current configuration and all generated files.”h]”(hÞ)�”}”(hŒcYou may see the following error: "The source tree is not clean, please run 'make ARCH=um mrproper'"”h]”hŒkYou may see the following error: “The source tree is not clean, please run ‘make ARCH=um mrproper’â€�”…”�”}”(hjNh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhjJubhÞ)�”}”(hŒýThis happens because internally kunit.py specifies ``.kunit`` (default option) as the build directory in the command ``make O=output/dir`` through the argument ``--build_dir``. Hence, before starting an out-of-tree build, the source tree must be clean.”h]”(hŒ3This happens because internally kunit.py specifies ”…”�”}”(hj\h²hh³Nh´NubhŒliteral”“”)�”}”(hŒ ``.kunit``”h]”hŒ.kunit”…”�”}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj\ubhŒ8 (default option) as the build directory in the command ”…”�”}”(hj\h²hh³Nh´Nubje)�”}”(hŒ``make O=output/dir``”h]”hŒmake O=output/dir”…”�”}”(hjxh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj\ubhŒ through the argument ”…”�”}”(hj\h²hh³Nh´Nubje)�”}”(hŒ``--build_dir``”h]”hŒ --build_dir”…”�”}”(hjŠh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj\ubhŒN. Hence, before starting an out-of-tree build, the source tree must be clean.”…”�”}”(hj\h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhjJubhÞ)�”}”(hXvThere is also the same caveat mentioned in the "Build directory for the kernel" section of the :doc:`admin-guide `, that is, its use, it must be used for all invocations of ``make``. The good news is that it can indeed be solved by running ``make ARCH=um mrproper``, just be aware that this will delete the current configuration and all generated files.”h]”(hŒcThere is also the same caveat mentioned in the “Build directory for the kernelâ€� section of the ”…”�”}”(hj¢h²hh³Nh´Nubh)�”}”(hŒ(:doc:`admin-guide `”h]”hŒinline”“”)�”}”(hj¬h]”hŒ admin-guide”…”�”}”(hj°h²hh³Nh´Nubah}”(h]”h ]”(Œxref”Œstd”Œstd-doc”eh"]”h$]”h&]”uh1j®hjªubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”Œdev-tools/kunit/start”Œ refdomain”j»Œreftype”Œdoc”Œ refexplicit”ˆŒrefwarn”ˆŒ reftarget”Œ/admin-guide/README”uh1hh³hÇh´K#hj¢ubhŒ;, that is, its use, it must be used for all invocations of ”…”�”}”(hj¢h²hh³Nh´Nubje)�”}”(hŒ``make``”h]”hŒmake”…”�”}”(hjÓh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj¢ubhŒ;. The good news is that it can indeed be solved by running ”…”�”}”(hj¢h²hh³Nh´Nubje)�”}”(hŒ``make ARCH=um mrproper``”h]”hŒmake ARCH=um mrproper”…”�”}”(hjåh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj¢ubhŒX, just be aware that this will delete the current configuration and all generated files.”…”�”}”(hj¢h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K#hjJubeh}”(h]”h ]”h"]”h$]”h&]”uh1jHhjh²hh³hÇh´NubhÞ)�”}”(hŒ=If everything worked correctly, you should see the following:”h]”hŒ=If everything worked correctly, you should see the following:”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K*hjh²hubj4)�”}”(hŒPConfiguring KUnit Kernel ... Building KUnit Kernel ... Starting KUnit Kernel ...”h]”hŒPConfiguring KUnit Kernel ... Building KUnit Kernel ... Starting KUnit Kernel ...”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDŒnone”jF}”uh1j3h³hÇh´K,hjh²hubhÞ)�”}”(hŒThe tests will pass or fail.”h]”hŒThe tests will pass or fail.”…”�”}”(hj!h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K2hjh²hubjI)�”}”(hŒpBecause it is building a lot of sources for the first time, the ``Building KUnit Kernel`` step may take a while.”h]”hÞ)�”}”(hŒpBecause it is building a lot of sources for the first time, the ``Building KUnit Kernel`` step may take a while.”h]”(hŒ@Because it is building a lot of sources for the first time, the ”…”�”}”(hj3h²hh³Nh´Nubje)�”}”(hŒ``Building KUnit Kernel``”h]”hŒBuilding KUnit Kernel”…”�”}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj3ubhŒ step may take a while.”…”�”}”(hj3h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K5hj/ubah}”(h]”h ]”h"]”h$]”h&]”uh1jHhjh²hh³hÇh´NubhÞ)�”}”(hŒ]For detailed information on this wrapper, see: Documentation/dev-tools/kunit/run_wrapper.rst.”h]”hŒ]For detailed information on this wrapper, see: Documentation/dev-tools/kunit/run_wrapper.rst.”…”�”}”(hjYh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K8hjh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒSelecting which tests to run”h]”hŒSelecting which tests to run”…”�”}”(hjjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjgh²hh³hÇh´Khjgh²hubhŒ bullet_list”“”)�”}”(hhh]”(hŒ list_item”“”)�”}”(hŒ5`Customizing Kconfig`_ used to compile the kernel, or”h]”hÞ)�”}”(hj�h]”(hŒ reference”“”)�”}”(hŒ`Customizing Kconfig`_”h]”hŒCustomizing Kconfig”…”�”}”(hj–h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”ŒCustomizing Kconfig”Œrefid”Œcustomizing-kconfig”uh1j”hj‘Œresolved”KubhŒ used to compile the kernel, or”…”�”}”(hj‘h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KBhj�ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hjˆh²hh³hÇh´NubjŒ)�”}”(hŒO`Filtering tests by name`_ to select specifically which compiled tests to run. ”h]”hÞ)�”}”(hŒN`Filtering tests by name`_ to select specifically which compiled tests to run.”h]”(j•)�”}”(hŒ`Filtering tests by name`_”h]”hŒFiltering tests by name”…”�”}”(hjÁh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”Œname”ŒFiltering tests by name”j¦Œfiltering-tests-by-name”uh1j”hj½j¨KubhŒ4 to select specifically which compiled tests to run.”…”�”}”(hj½h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KChj¹ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hjˆh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œbullet”Œ-”uh1j†h³hÇh´KBhjgh²hubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒCustomizing Kconfig”h]”hŒCustomizing Kconfig”…”�”}”(hjíh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjêh²hh³hÇh´KFubhÞ)�”}”(hŒ“A good starting point for the ``.kunitconfig`` is the KUnit default config. If you didn't run ``kunit.py run`` yet, you can generate it by running:”h]”(hŒA good starting point for the ”…”�”}”(hjûh²hh³Nh´Nubje)�”}”(hŒ``.kunitconfig``”h]”hŒ .kunitconfig”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjûubhŒ2 is the KUnit default config. If you didn’t run ”…”�”}”(hjûh²hh³Nh´Nubje)�”}”(hŒ``kunit.py run``”h]”hŒ kunit.py run”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjûubhŒ% yet, you can generate it by running:”…”�”}”(hjûh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KGhjêh²hubj4)�”}”(hŒRcd $PATH_TO_LINUX_REPO tools/testing/kunit/kunit.py config cat .kunit/.kunitconfig”h]”hŒRcd $PATH_TO_LINUX_REPO tools/testing/kunit/kunit.py config cat .kunit/.kunitconfig”…”�”}”hj-sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDŒbash”jF}”uh1j3h³hÇh´KJhjêh²hubjI)�”}”(hŒ_``.kunitconfig`` lives in the ``--build_dir`` used by kunit.py, which is ``.kunit`` by default.”h]”hÞ)�”}”(hŒ_``.kunitconfig`` lives in the ``--build_dir`` used by kunit.py, which is ``.kunit`` by default.”h]”(je)�”}”(hŒ``.kunitconfig``”h]”hŒ .kunitconfig”…”�”}”(hjEh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjAubhŒ lives in the ”…”�”}”(hjAh²hh³Nh´Nubje)�”}”(hŒ``--build_dir``”h]”hŒ --build_dir”…”�”}”(hjWh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjAubhŒ used by kunit.py, which is ”…”�”}”(hjAh²hh³Nh´Nubje)�”}”(hŒ ``.kunit``”h]”hŒ.kunit”…”�”}”(hjih²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjAubhŒ by default.”…”�”}”(hjAh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KQhj=ubah}”(h]”h ]”h"]”h$]”h&]”uh1jHhjêh²hh³hÇh´NubhÞ)�”}”(hŒÌBefore running the tests, kunit_tool ensures that all config options set in ``.kunitconfig`` are set in the kernel ``.config``. It will warn you if you have not included dependencies for the options used.”h]”(hŒLBefore running the tests, kunit_tool ensures that all config options set in ”…”�”}”(hj‡h²hh³Nh´Nubje)�”}”(hŒ``.kunitconfig``”h]”hŒ .kunitconfig”…”�”}”(hj�h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj‡ubhŒ are set in the kernel ”…”�”}”(hj‡h²hh³Nh´Nubje)�”}”(hŒ ``.config``”h]”hŒ.config”…”�”}”(hj¡h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj‡ubhŒN. It will warn you if you have not included dependencies for the options used.”…”�”}”(hj‡h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KThjêh²hubhÞ)�”}”(hŒ4There are many ways to customize the configurations:”h]”hŒ4There are many ways to customize the configurations:”…”�”}”(hj¹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KXhjêh²hubhŒenumerated_list”“”)�”}”(hhh]”(jŒ)�”}”(hXpEdit ``.kunit/.kunitconfig``. The file should contain the list of kconfig options required to run the desired tests, including their dependencies. You may want to remove CONFIG_KUNIT_ALL_TESTS from the ``.kunitconfig`` as it will enable a number of additional tests that you may not want. If you need to run on an architecture other than UML see :ref:`kunit-on-qemu`. ”h]”hÞ)�”}”(hXoEdit ``.kunit/.kunitconfig``. The file should contain the list of kconfig options required to run the desired tests, including their dependencies. You may want to remove CONFIG_KUNIT_ALL_TESTS from the ``.kunitconfig`` as it will enable a number of additional tests that you may not want. If you need to run on an architecture other than UML see :ref:`kunit-on-qemu`.”h]”(hŒEdit ”…”�”}”(hjÐh²hh³Nh´Nubje)�”}”(hŒ``.kunit/.kunitconfig``”h]”hŒ.kunit/.kunitconfig”…”�”}”(hjØh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjÐubhŒ®. The file should contain the list of kconfig options required to run the desired tests, including their dependencies. You may want to remove CONFIG_KUNIT_ALL_TESTS from the ”…”�”}”(hjÐh²hh³Nh´Nubje)�”}”(hŒ``.kunitconfig``”h]”hŒ .kunitconfig”…”�”}”(hjêh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjÐubhŒ€ as it will enable a number of additional tests that you may not want. If you need to run on an architecture other than UML see ”…”�”}”(hjÐh²hh³Nh´Nubh)�”}”(hŒ:ref:`kunit-on-qemu`”h]”j¯)�”}”(hjþh]”hŒ kunit-on-qemu”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”(jºŒstd”Œstd-ref”eh"]”h$]”h&]”uh1j®hjüubah}”(h]”h ]”h"]”h$]”h&]”Œrefdoc”jÇŒ refdomain”j Œreftype”Œref”Œ refexplicit”‰Œrefwarn”ˆjÍŒ kunit-on-qemu”uh1hh³hÇh´KZhjÐubhŒ.”…”�”}”(hjÐh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KZhjÌubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hjÉh²hh³hÇh´NubjŒ)�”}”(hŒèEnable additional kconfig options on top of ``.kunit/.kunitconfig``. For example, to include the kernel's linked-list test you can run:: ./tools/testing/kunit/kunit.py run \ --kconfig_add CONFIG_LIST_KUNIT_TEST=y ”h]”(hÞ)�”}”(hŒˆEnable additional kconfig options on top of ``.kunit/.kunitconfig``. For example, to include the kernel's linked-list test you can run::”h]”(hŒ,Enable additional kconfig options on top of ”…”�”}”(hj0h²hh³Nh´Nubje)�”}”(hŒ``.kunit/.kunitconfig``”h]”hŒ.kunit/.kunitconfig”…”�”}”(hj8h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj0ubhŒF. For example, to include the kernel’s linked-list test you can run:”…”�”}”(hj0h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K`hj,ubj4)�”}”(hŒS./tools/testing/kunit/kunit.py run \ --kconfig_add CONFIG_LIST_KUNIT_TEST=y”h]”hŒS./tools/testing/kunit/kunit.py run \ --kconfig_add CONFIG_LIST_KUNIT_TEST=y”…”�”}”hjPsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j3h³hÇh´Kchj,ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j‹hjÉh²hh³hÇh´NubjŒ)�”}”(hXProvide the path of one or more .kunitconfig files from the tree. For example, to run only ``FAT_FS`` and ``EXT4`` tests you can run:: ./tools/testing/kunit/kunit.py run \ --kunitconfig ./fs/fat/.kunitconfig \ --kunitconfig ./fs/ext4/.kunitconfig ”h]”(hÞ)�”}”(hŒ†Provide the path of one or more .kunitconfig files from the tree. For example, to run only ``FAT_FS`` and ``EXT4`` tests you can run::”h]”(hŒ[Provide the path of one or more .kunitconfig files from the tree. For example, to run only ”…”�”}”(hjhh²hh³Nh´Nubje)�”}”(hŒ ``FAT_FS``”h]”hŒFAT_FS”…”�”}”(hjph²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjhubhŒ and ”…”�”}”(hjhh²hh³Nh´Nubje)�”}”(hŒ``EXT4``”h]”hŒEXT4”…”�”}”(hj‚h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjhubhŒ tests you can run:”…”�”}”(hjhh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kfhjdubj4)�”}”(hŒ./tools/testing/kunit/kunit.py run \ --kunitconfig ./fs/fat/.kunitconfig \ --kunitconfig ./fs/ext4/.kunitconfig”h]”hŒ./tools/testing/kunit/kunit.py run \ --kunitconfig ./fs/fat/.kunitconfig \ --kunitconfig ./fs/ext4/.kunitconfig”…”�”}”hjšsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j3h³hÇh´Kihjdubeh}”(h]”h ]”h"]”h$]”h&]”uh1j‹hjÉh²hh³hÇh´NubjŒ)�”}”(hXIf you change the ``.kunitconfig``, kunit.py will trigger a rebuild of the ``.config`` file. But you can edit the ``.config`` file directly or with tools like ``make menuconfig O=.kunit``. As long as its a superset of ``.kunitconfig``, kunit.py won't overwrite your changes. ”h]”hÞ)�”}”(hXIf you change the ``.kunitconfig``, kunit.py will trigger a rebuild of the ``.config`` file. But you can edit the ``.config`` file directly or with tools like ``make menuconfig O=.kunit``. As long as its a superset of ``.kunitconfig``, kunit.py won't overwrite your changes.”h]”(hŒIf you change the ”…”�”}”(hj²h²hh³Nh´Nubje)�”}”(hŒ``.kunitconfig``”h]”hŒ .kunitconfig”…”�”}”(hjºh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj²ubhŒ), kunit.py will trigger a rebuild of the ”…”�”}”(hj²h²hh³Nh´Nubje)�”}”(hŒ ``.config``”h]”hŒ.config”…”�”}”(hjÌh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj²ubhŒ file. But you can edit the ”…”�”}”(hj²h²hh³Nh´Nubje)�”}”(hŒ ``.config``”h]”hŒ.config”…”�”}”(hjÞh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj²ubhŒ" file directly or with tools like ”…”�”}”(hj²h²hh³Nh´Nubje)�”}”(hŒ``make menuconfig O=.kunit``”h]”hŒmake menuconfig O=.kunit”…”�”}”(hjðh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj²ubhŒ. As long as its a superset of ”…”�”}”(hj²h²hh³Nh´Nubje)�”}”(hŒ``.kunitconfig``”h]”hŒ .kunitconfig”…”�”}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj²ubhŒ*, kunit.py won’t overwrite your changes.”…”�”}”(hj²h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kmhj®ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hjÉh²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”Œenumtype”Œ loweralpha”Œprefix”hŒsuffix”Œ.”uh1jÇhjêh²hh³hÇh´KZubjI)�”}”(hŒ˜To save a .kunitconfig after finding a satisfactory configuration:: make savedefconfig O=.kunit cp .kunit/defconfig .kunit/.kunitconfig”h]”(hÞ)�”}”(hŒCTo save a .kunitconfig after finding a satisfactory configuration::”h]”hŒBTo save a .kunitconfig after finding a satisfactory configuration:”…”�”}”(hj/h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kuhj+ubj4)�”}”(hŒCmake savedefconfig O=.kunit cp .kunit/defconfig .kunit/.kunitconfig”h]”hŒCmake savedefconfig O=.kunit cp .kunit/defconfig .kunit/.kunitconfig”…”�”}”hj=sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j3h³hÇh´Kwhj+ubeh}”(h]”h ]”h"]”h$]”h&]”uh1jHhjêh²hh³hÇh´Nubeh}”(h]”j§ah ]”h"]”Œcustomizing kconfig”ah$]”h&]”uh1hÈhjgh²hh³hÇh´KFŒ referenced”KubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒFiltering tests by name”h]”hŒFiltering tests by name”…”�”}”(hj\h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjYh²hh³hÇh´K{ubhÞ)�”}”(hXçIf you want to be more specific than Kconfig can provide, it is also possible to select which tests to execute at boot-time by passing a glob filter (read instructions regarding the pattern in the manpage :manpage:`glob(7)`). If there is a ``"."`` (period) in the filter, it will be interpreted as a separator between the name of the test suite and the test case, otherwise, it will be interpreted as the name of the test suite. For example, let's assume we are using the default config:”h]”(hŒÍIf you want to be more specific than Kconfig can provide, it is also possible to select which tests to execute at boot-time by passing a glob filter (read instructions regarding the pattern in the manpage ”…”�”}”(hjjh²hh³Nh´NubhŒmanpage”“”)�”}”(hŒ:manpage:`glob(7)`”h]”hŒglob(7)”…”�”}”(hjth²hh³Nh´Nubah}”(h]”h ]”jrah"]”h$]”h&]”hÅhÆŒpath”Œglob(7)”Œpage”Œglob”Œsection”Œ7”uh1jrhjjubhŒ). If there is a ”…”�”}”(hjjh²hh³Nh´Nubje)�”}”(hŒ``"."``”h]”hŒ"."”…”�”}”(hjŒh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjjubhŒò (period) in the filter, it will be interpreted as a separator between the name of the test suite and the test case, otherwise, it will be interpreted as the name of the test suite. For example, let’s assume we are using the default config:”…”�”}”(hjjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K|hjYh²hubjÈ)�”}”(hhh]”(jŒ)�”}”(hŒ¥inform the name of a test suite, like ``"kunit_executor_test"``, to run every test case it contains:: ./tools/testing/kunit/kunit.py run "kunit_executor_test" ”h]”(hÞ)�”}”(hŒeinform the name of a test suite, like ``"kunit_executor_test"``, to run every test case it contains::”h]”(hŒ&inform the name of a test suite, like ”…”�”}”(hj«h²hh³Nh´Nubje)�”}”(hŒ``"kunit_executor_test"``”h]”hŒ"kunit_executor_test"”…”�”}”(hj³h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj«ubhŒ%, to run every test case it contains:”…”�”}”(hj«h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K„hj§ubj4)�”}”(hŒ8./tools/testing/kunit/kunit.py run "kunit_executor_test"”h]”hŒ8./tools/testing/kunit/kunit.py run "kunit_executor_test"”…”�”}”hjËsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j3h³hÇh´K‡hj§ubeh}”(h]”h ]”h"]”h$]”h&]”uh1j‹hj¤h²hh³hÇh´NubjŒ)�”}”(hŒÏinform the name of a test case prefixed by its test suite, like ``"example.example_simple_test"``, to run specifically that test case:: ./tools/testing/kunit/kunit.py run "example.example_simple_test" ”h]”(hÞ)�”}”(hŒ‡inform the name of a test case prefixed by its test suite, like ``"example.example_simple_test"``, to run specifically that test case::”h]”(hŒ@inform the name of a test case prefixed by its test suite, like ”…”�”}”(hjãh²hh³Nh´Nubje)�”}”(hŒ!``"example.example_simple_test"``”h]”hŒ"example.example_simple_test"”…”�”}”(hjëh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjãubhŒ%, to run specifically that test case:”…”�”}”(hjãh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K‰hjßubj4)�”}”(hŒ@./tools/testing/kunit/kunit.py run "example.example_simple_test"”h]”hŒ@./tools/testing/kunit/kunit.py run "example.example_simple_test"”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j3h³hÇh´KŒhjßubeh}”(h]”h ]”h"]”h$]”h&]”uh1j‹hj¤h²hh³hÇh´NubjŒ)�”}”(hŒßuse wildcard characters (``*?[``) to run any test case that matches the pattern, like ``"*.*64*"`` to run test cases containing ``"64"`` in the name inside any test suite:: ./tools/testing/kunit/kunit.py run "*.*64*" ”h]”(hÞ)�”}”(hŒ¬use wildcard characters (``*?[``) to run any test case that matches the pattern, like ``"*.*64*"`` to run test cases containing ``"64"`` in the name inside any test suite::”h]”(hŒuse wildcard characters (”…”�”}”(hjh²hh³Nh´Nubje)�”}”(hŒ``*?[``”h]”hŒ*?[”…”�”}”(hj#h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjubhŒ6) to run any test case that matches the pattern, like ”…”�”}”(hjh²hh³Nh´Nubje)�”}”(hŒ ``"*.*64*"``”h]”hŒ"*.*64*"”…”�”}”(hj5h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjubhŒ to run test cases containing ”…”�”}”(hjh²hh³Nh´Nubje)�”}”(hŒ``"64"``”h]”hŒ"64"”…”�”}”(hjGh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjubhŒ# in the name inside any test suite:”…”�”}”(hjh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KŽhjubj4)�”}”(hŒ+./tools/testing/kunit/kunit.py run "*.*64*"”h]”hŒ+./tools/testing/kunit/kunit.py run "*.*64*"”…”�”}”hj_sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆuh1j3h³hÇh´K’hjubeh}”(h]”h ]”h"]”h$]”h&]”uh1j‹hj¤h²hh³hÇh´Nubeh}”(h]”h ]”h"]”h$]”h&]”j&j'j(hj)j*uh1jÇhjYh²hh³hÇh´K„ubeh}”(h]”jÑah ]”h"]”Œfiltering tests by name”ah$]”h&]”uh1hÈhjgh²hh³hÇh´K{jXKubeh}”(h]”Œselecting-which-tests-to-run”ah ]”h"]”Œselecting which tests to run”ah$]”h&]”uh1hÈhjh²hh³hÇh´KSome lines and/or data may get interspersed in the TAP output.”h]”hÞ)�”}”(hjah]”hŒ>Some lines and/or data may get interspersed in the TAP output.”…”�”}”(hjch²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K²hj_ubah}”(h]”h ]”h"]”h$]”h&]”uh1jHhj@h²hh³hÇh´Nubeh}”(h]”Œ#running-tests-without-kunit-wrapper”ah ]”h"]”Œ%running tests (without kunit wrapper)”ah$]”h&]”uh1hÈhj�h²hh³hÇh´K¬ubeh}”(h]”Œ'running-tests-without-the-kunit-wrapper”ah ]”h"]”Œ'running tests without the kunit wrapper”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K•ubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒWriting Your First Test”h]”hŒWriting Your First Test”…”�”}”(hj‰h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj†h²hh³hÇh´KµubhÞ)�”}”(hŒ@In your kernel repository, let's add some code that we can test.”h]”hŒBIn your kernel repository, let’s add some code that we can test.”…”�”}”(hj—h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¶hj†h²hubjÈ)�”}”(hhh]”jŒ)�”}”(hŒ:Create a file ``drivers/misc/example.h``, which includes: ”h]”hÞ)�”}”(hŒ9Create a file ``drivers/misc/example.h``, which includes:”h]”(hŒCreate a file ”…”�”}”(hj¬h²hh³Nh´Nubje)�”}”(hŒ``drivers/misc/example.h``”h]”hŒdrivers/misc/example.h”…”�”}”(hj´h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj¬ubhŒ, which includes:”…”�”}”(hj¬h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¸hj¨ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hj¥h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j&Œarabic”j(hj)j*uh1jÇhj†h²hh³hÇh´K¸ubj4)�”}”(hŒ*int misc_example_add(int left, int right);”h]”hŒ*int misc_example_add(int left, int right);”…”�”}”hjÙsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDŒc”jF}”uh1j3h³hÇh´Kºhj†h²hubjÈ)�”}”(hhh]”jŒ)�”}”(hŒ:Create a file ``drivers/misc/example.c``, which includes: ”h]”hÞ)�”}”(hŒ9Create a file ``drivers/misc/example.c``, which includes:”h]”(hŒCreate a file ”…”�”}”(hjðh²hh³Nh´Nubje)�”}”(hŒ``drivers/misc/example.c``”h]”hŒdrivers/misc/example.c”…”�”}”(hjøh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjðubhŒ, which includes:”…”�”}”(hjðh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K¾hjìubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hjéh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j&jØj(hj)j*Œstart”Kuh1jÇhj†h²hh³hÇh´K¾ubj4)�”}”(hŒz#include #include "example.h" int misc_example_add(int left, int right) { return left + right; }”h]”hŒz#include #include "example.h" int misc_example_add(int left, int right) { return left + right; }”…”�”}”hjsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDjçjF}”uh1j3h³hÇh´KÀhj†h²hubjÈ)�”}”(hhh]”jŒ)�”}”(hŒ5Add the following lines to ``drivers/misc/Kconfig``: ”h]”hÞ)�”}”(hŒ4Add the following lines to ``drivers/misc/Kconfig``:”h]”(hŒAdd the following lines to ”…”�”}”(hj3h²hh³Nh´Nubje)�”}”(hŒ``drivers/misc/Kconfig``”h]”hŒdrivers/misc/Kconfig”…”�”}”(hj;h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj3ubhŒ:”…”�”}”(hj3h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KËhj/ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hj,h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j&jØj(hj)j*jKuh1jÇhj†h²hh³hÇh´KËubj4)�”}”(hŒ-config MISC_EXAMPLE bool "My example"”h]”hŒ-config MISC_EXAMPLE bool "My example"”…”�”}”hj_sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDŒkconfig”jF}”uh1j3h³hÇh´KÍhj†h²hubjÈ)�”}”(hhh]”jŒ)�”}”(hŒ6Add the following lines to ``drivers/misc/Makefile``: ”h]”hÞ)�”}”(hŒ5Add the following lines to ``drivers/misc/Makefile``:”h]”(hŒAdd the following lines to ”…”�”}”(hjvh²hh³Nh´Nubje)�”}”(hŒ``drivers/misc/Makefile``”h]”hŒdrivers/misc/Makefile”…”�”}”(hj~h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjvubhŒ:”…”�”}”(hjvh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KÒhjrubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hjoh²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j&jØj(hj)j*jKuh1jÇhj†h²hh³hÇh´KÒubj4)�”}”(hŒ'obj-$(CONFIG_MISC_EXAMPLE) += example.o”h]”hŒ'obj-$(CONFIG_MISC_EXAMPLE) += example.o”…”�”}”hj¢sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDŒmake”jF}”uh1j3h³hÇh´KÔhj†h²hubhÞ)�”}”(hŒ)Now we are ready to write the test cases.”h]”hŒ)Now we are ready to write the test cases.”…”�”}”(hj²h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KØhj†h²hubjÈ)�”}”(hhh]”jŒ)�”}”(hŒ #include "example.h" /* Define the test cases. */ static void misc_example_add_test_basic(struct kunit *test) { KUNIT_EXPECT_EQ(test, 1, misc_example_add(1, 0)); KUNIT_EXPECT_EQ(test, 2, misc_example_add(1, 1)); KUNIT_EXPECT_EQ(test, 0, misc_example_add(-1, 1)); KUNIT_EXPECT_EQ(test, INT_MAX, misc_example_add(0, INT_MAX)); KUNIT_EXPECT_EQ(test, -1, misc_example_add(INT_MAX, INT_MIN)); } static void misc_example_test_failure(struct kunit *test) { KUNIT_FAIL(test, "This test never passes."); } static struct kunit_case misc_example_test_cases[] = { KUNIT_CASE(misc_example_add_test_basic), KUNIT_CASE(misc_example_test_failure), {} }; static struct kunit_suite misc_example_test_suite = { .name = "misc-example", .test_cases = misc_example_test_cases, }; kunit_test_suite(misc_example_test_suite); MODULE_LICENSE("GPL");”h]”hX­#include #include "example.h" /* Define the test cases. */ static void misc_example_add_test_basic(struct kunit *test) { KUNIT_EXPECT_EQ(test, 1, misc_example_add(1, 0)); KUNIT_EXPECT_EQ(test, 2, misc_example_add(1, 1)); KUNIT_EXPECT_EQ(test, 0, misc_example_add(-1, 1)); KUNIT_EXPECT_EQ(test, INT_MAX, misc_example_add(0, INT_MAX)); KUNIT_EXPECT_EQ(test, -1, misc_example_add(INT_MAX, INT_MIN)); } static void misc_example_test_failure(struct kunit *test) { KUNIT_FAIL(test, "This test never passes."); } static struct kunit_case misc_example_test_cases[] = { KUNIT_CASE(misc_example_add_test_basic), KUNIT_CASE(misc_example_test_failure), {} }; static struct kunit_suite misc_example_test_suite = { .name = "misc-example", .test_cases = misc_example_test_cases, }; kunit_test_suite(misc_example_test_suite); MODULE_LICENSE("GPL");”…”�”}”hjósbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDjçjF}”uh1j3h³hÇh´KÜhj†h²hubjÈ)�”}”(hhh]”jŒ)�”}”(hŒ5Add the following lines to ``drivers/misc/Kconfig``: ”h]”hÞ)�”}”(hŒ4Add the following lines to ``drivers/misc/Kconfig``:”h]”(hŒAdd the following lines to ”…”�”}”(hj h²hh³Nh´Nubje)�”}”(hŒ``drivers/misc/Kconfig``”h]”hŒdrivers/misc/Kconfig”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj ubhŒ:”…”�”}”(hj h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Kÿhj ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hj h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j&jØj(hj)j*jKuh1jÇhj†h²hh³hÇh´Kÿubj4)�”}”(hŒœconfig MISC_EXAMPLE_TEST tristate "Test for my example" if !KUNIT_ALL_TESTS depends on MISC_EXAMPLE && KUNIT default KUNIT_ALL_TESTS”h]”hŒœconfig MISC_EXAMPLE_TEST tristate "Test for my example" if !KUNIT_ALL_TESTS depends on MISC_EXAMPLE && KUNIT default KUNIT_ALL_TESTS”…”�”}”hj5 sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDŒkconfig”jF}”uh1j3h³hÇh´Mhj†h²hubhÞ)�”}”(hŒžNote: If your test does not support being built as a loadable module (which is discouraged), replace tristate by bool, and depend on KUNIT=y instead of KUNIT.”h]”hŒžNote: If your test does not support being built as a loadable module (which is discouraged), replace tristate by bool, and depend on KUNIT=y instead of KUNIT.”…”�”}”(hjE h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj†h²hubjÈ)�”}”(hhh]”jŒ)�”}”(hŒ6Add the following lines to ``drivers/misc/Makefile``: ”h]”hÞ)�”}”(hŒ5Add the following lines to ``drivers/misc/Makefile``:”h]”(hŒAdd the following lines to ”…”�”}”(hjZ h²hh³Nh´Nubje)�”}”(hŒ``drivers/misc/Makefile``”h]”hŒdrivers/misc/Makefile”…”�”}”(hjb h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhjZ ubhŒ:”…”�”}”(hjZ h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M hjV ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hjS h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j&jØj(hj)j*jKuh1jÇhj†h²hh³hÇh´M ubj4)�”}”(hŒ1obj-$(CONFIG_MISC_EXAMPLE_TEST) += example_test.o”h]”hŒ1obj-$(CONFIG_MISC_EXAMPLE_TEST) += example_test.o”…”�”}”hj† sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDŒmake”jF}”uh1j3h³hÇh´M hj†h²hubjÈ)�”}”(hhh]”jŒ)�”}”(hŒ4Add the following lines to ``.kunit/.kunitconfig``: ”h]”hÞ)�”}”(hŒ3Add the following lines to ``.kunit/.kunitconfig``:”h]”(hŒAdd the following lines to ”…”�”}”(hj� h²hh³Nh´Nubje)�”}”(hŒ``.kunit/.kunitconfig``”h]”hŒ.kunit/.kunitconfig”…”�”}”(hj¥ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jdhj� ubhŒ:”…”�”}”(hj� h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj™ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hj– h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j&jØj(hj)j*jKuh1jÇhj†h²hh³hÇh´Mubj4)�”}”(hŒ0CONFIG_MISC_EXAMPLE=y CONFIG_MISC_EXAMPLE_TEST=y”h]”hŒ0CONFIG_MISC_EXAMPLE=y CONFIG_MISC_EXAMPLE_TEST=y”…”�”}”hjÉ sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDŒnone”jF}”uh1j3h³hÇh´Mhj†h²hubjÈ)�”}”(hhh]”jŒ)�”}”(hŒRun the test: ”h]”hÞ)�”}”(hŒ Run the test:”h]”hŒ Run the test:”…”�”}”(hjà h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´MhjÜ ubah}”(h]”h ]”h"]”h$]”h&]”uh1j‹hjÙ h²hh³hÇh´Nubah}”(h]”h ]”h"]”h$]”h&]”j&jØj(hj)j*jKuh1jÇhj†h²hh³hÇh´Mubj4)�”}”(hŒ"./tools/testing/kunit/kunit.py run”h]”hŒ"./tools/testing/kunit/kunit.py run”…”�”}”hjú sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDŒbash”jF}”uh1j3h³hÇh´Mhj†h²hubhÞ)�”}”(hŒ%You should see the following failure:”h]”hŒ%You should see the following failure:”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Mhj†h²hubj4)�”}”(hŒç... [16:08:57] [PASSED] misc-example:misc_example_add_test_basic [16:08:57] [FAILED] misc-example:misc_example_test_failure [16:08:57] EXPECTATION FAILED at drivers/misc/example-test.c:17 [16:08:57] This test never passes. ...”h]”hŒç... [16:08:57] [PASSED] misc-example:misc_example_add_test_basic [16:08:57] [FAILED] misc-example:misc_example_test_failure [16:08:57] EXPECTATION FAILED at drivers/misc/example-test.c:17 [16:08:57] This test never passes. ...”…”�”}”hj sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆjC‰jDŒnone”jF}”uh1j3h³hÇh´M hj†h²hubhÞ)�”}”(hŒ/Congrats! You just wrote your first KUnit test.”h]”hŒ/Congrats! You just wrote your first KUnit test.”…”�”}”(hj( h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M)hj†h²hubeh}”(h]”Œwriting-your-first-test”ah ]”h"]”Œwriting your first test”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´KµubhÉ)�”}”(hhh]”(hÎ)�”}”(hŒ Next Steps”h]”hŒ Next Steps”…”�”}”(hjA h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj> h²hh³hÇh´M,ubhÞ)�”}”(hŒŠIf you're interested in using some of the more advanced features of kunit.py, take a look at Documentation/dev-tools/kunit/run_wrapper.rst”h]”hŒŒIf you’re interested in using some of the more advanced features of kunit.py, take a look at Documentation/dev-tools/kunit/run_wrapper.rst”…”�”}”(hjO h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M.hj> h²hubhÞ)�”}”(hŒiIf you'd like to run tests without using kunit.py, check out Documentation/dev-tools/kunit/run_manual.rst”h]”hŒkIf you’d like to run tests without using kunit.py, check out Documentation/dev-tools/kunit/run_manual.rst”…”�”}”(hj] h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M1hj> h²hubhÞ)�”}”(hŒ˜For more information on writing KUnit tests (including some common techniques for testing different things), see Documentation/dev-tools/kunit/usage.rst”h]”hŒ˜For more information on writing KUnit tests (including some common techniques for testing different things), see Documentation/dev-tools/kunit/usage.rst”…”�”}”(hjk h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´M4hj> h²hubeh}”(h]”Œ next-steps”ah ]”h"]”Œ next steps”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´M,ubeh}”(h]”Œgetting-started”ah ]”h"]”Œgetting started”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”}”(Œcustomizing kconfig”]”j–aŒfiltering tests by name”]”jÁauŒrefids”}”Œnameids”}”(j† jƒ jjj�jŠj…j‚jUj§j}jÑjƒj€j=j:j{jxj; j8 j~ j{ uŒ nametypes”}”(j† ‰j‰j�‰j…‰jU‰j}‰jƒ‰j=‰j{‰j; ‰j~ ‰uh}”(jƒ hÊjhíjŠjj‚jgj§jêjÑjYj€j�j:jÕjxj@j8 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”]”(hŒsystem_message”“”)�”}”(hhh]”hÞ)�”}”(hŒ:Enumerated list start value not ordinal-1: "2" (ordinal 2)”h]”hŒ>Enumerated list start value not ordinal-1: “2â€� (ordinal 2)”…”�”}”(hj h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhj ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”ŒINFO”Œsource”hÇŒline”Kuh1j hj†h²hh³hÇh´K¾ubj )�”}”(hhh]”hÞ)�”}”(hŒ:Enumerated list start value not ordinal-1: "3" (ordinal 3)”h]”hŒ>Enumerated list start value not ordinal-1: “3â€� (ordinal 3)”…”�”}”(hj3 h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhj0 ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j- Œsource”hÇŒline”Kuh1j hj†h²hh³hÇh´KËubj )�”}”(hhh]”hÞ)�”}”(hŒ:Enumerated list start value not ordinal-1: "4" (ordinal 4)”h]”hŒ>Enumerated list start value not ordinal-1: “4â€� (ordinal 4)”…”�”}”(hjN h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjK ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j- Œsource”hÇŒline”Kuh1j hj†h²hh³hÇh´KÒubj )�”}”(hhh]”hÞ)�”}”(hŒ:Enumerated list start value not ordinal-1: "2" (ordinal 2)”h]”hŒ>Enumerated list start value not ordinal-1: “2â€� (ordinal 2)”…”�”}”(hji h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjf ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j- Œsource”hÇŒline”Kuh1j hj†h²hh³hÇh´Kÿubj )�”}”(hhh]”hÞ)�”}”(hŒ:Enumerated list start value not ordinal-1: "3" (ordinal 3)”h]”hŒ>Enumerated list start value not ordinal-1: “3â€� (ordinal 3)”…”�”}”(hj„ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhj� ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j- Œsource”hÇŒline”Kuh1j hj†h²hh³hÇh´M ubj )�”}”(hhh]”hÞ)�”}”(hŒ:Enumerated list start value not ordinal-1: "4" (ordinal 4)”h]”hŒ>Enumerated list start value not ordinal-1: “4â€� (ordinal 4)”…”�”}”(hjŸ h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhjœ ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j- Œsource”hÇŒline”Kuh1j hj†h²hh³hÇh´Mubj )�”}”(hhh]”hÞ)�”}”(hŒ:Enumerated list start value not ordinal-1: "5" (ordinal 5)”h]”hŒ>Enumerated list start value not ordinal-1: “5â€� (ordinal 5)”…”�”}”(hjº h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÝhj· ubah}”(h]”h ]”h"]”h$]”h&]”Œlevel”KŒtype”j- Œsource”hÇŒline”Kuh1j hj†h²hh³hÇh´MubeŒtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.