Skip to contentSkip to conversation

kunit: arch/um/configs: Enable KUNIT_ALL_TESTS by default

PATCH In review David Gow 2 participants 5 messages May 22, 2021 – Jun 16, 2021

Subsystems (5)
lore
Share & tools
lore

David Gow

author
#0 lore raw

PATCH v2 1/3 kunit: arch/um/configs: Enable KUNIT_ALL_TESTS by default

Make the default .kunitconfig (specified in arch/um/configs/kunit_defconfig) specify CONFIG_KUNIT_ALL_TESTS by default. KUNIT_ALL_TESTS runs all tests which have satisfied dependencies in the current .config (which would be the architecture defconfig).

Currently, the default .kunitconfig enables only the example tests and KUnit's own tests. While this does provide a good example of what a .kunitconfig for running a few individual tests should look like, it does mean that kunit_tool runs a pretty paltry collection of tests by default.

The example tests' config entry (CONFIG_KUNIT_EXAMPLE_TEST=y) continues to be included -- despite now being redundant -- to provide an example of how tests are enabled when KUNIT_ALL_TESTS is disabled.

A default run of ./tools/testing/kunit/kunit.py run now runs 70 tests instead of 14.

---

Changes since v1:
https://lore.kernel.org/linux-kselftest/[email protected]/
- Keep the KUNIT_EXAMPLE_TEST entry as an example.
- Move (in patches 2,3) kunit_defconfig to tools/testing/kunit/configs and replace all_tests.config.

 arch/um/configs/kunit_defconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/um/configs/kunit_defconfig +1 -1
index 9235b7d42d38..e67af7b9f1bb 100644
@@ -1,3 +1,3 @@
 CONFIG_KUNIT=y
-CONFIG_KUNIT_TEST=y
 CONFIG_KUNIT_EXAMPLE_TEST=y
+CONFIG_KUNIT_ALL_TESTS=y
Signature · 1 line
2.31.1.818.g46aad6cb9e-goog
author
#1 lore raw

PATCH v2 2/3 kunit: Move default config from arch/um -> tools/testing/kunit

The default .kunitconfig file is currently kept in arch/um/configs/kunit_defconfig, but -- with the impending QEMU patch -- will no-longer be exclusively used for UML-based kernels.

Move it alongside the other KUnit configs in tools/testing/kunit/configs, and give it a name which matches the existing all_tests.config and broken_on_uml.config files.

Also update the Getting Started documentation to point to the new file.

---
 Documentation/dev-tools/kunit/start.rst                         | 2 +-
 .../testing/kunit/configs/default.config                        | 0
 tools/testing/kunit/kunit_kernel.py                             | 2 +-
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename arch/um/configs/kunit_defconfig => tools/testing/kunit/configs/default.config (100%)
Documentation/dev-tools/kunit/start.rst +1 -1
index 0e65cabe08eb..5becb09b1751 100644
@@ -36,7 +36,7 @@ A good starting point for a ``.kunitconfig`` is the KUnit defconfig:
 .. code-block:: bash
 
 	cd $PATH_TO_LINUX_REPO
-	cp arch/um/configs/kunit_defconfig .kunitconfig
+	cp tools/testing/kunit/configs/default.config .kunitconfig
 
 You can then add any other Kconfig options you wish, e.g.:
 
tools/testing/kunit/configs/default.config renamed from arch/um/configs/kunit_defconfig +0 -0
similarity index 100%
rename from arch/um/configs/kunit_defconfig
rename to tools/testing/kunit/configs/default.config
tools/testing/kunit/kunit_kernel.py +1 -1
index 89a7d4024e87..5b57a43de33f 100644
@@ -20,7 +20,7 @@ import kunit_parser
 
 KCONFIG_PATH = '.config'
 KUNITCONFIG_PATH = '.kunitconfig'
-DEFAULT_KUNITCONFIG_PATH = 'arch/um/configs/kunit_defconfig'
+DEFAULT_KUNITCONFIG_PATH = 'tools/testing/kunit/configs/default.config'
 BROKEN_ALLCONFIG_PATH = 'tools/testing/kunit/configs/broken_on_uml.config'
 OUTFILE_PATH = 'test.log'
 
Signature · 1 line
2.31.1.818.g46aad6cb9e-goog
Reviewed-by on v2 2/3
#2 lore raw

Re: [PATCH v2 2/3] kunit: Move default config from arch/um -> tools/testing/kunit

Quoted 5 lines · David Gow

The default .kunitconfig file is currently kept in arch/um/configs/kunit_defconfig, but -- with the impending QEMU patch -- will no-longer be exclusively used for UML-based kernels.

Quoted 7 lines

Move it alongside the other KUnit configs in tools/testing/kunit/configs, and give it a name which matches the existing all_tests.config and broken_on_uml.config files.

Also update the Getting Started documentation to point to the new file.

author
#3 lore raw

PATCH v2 3/3 kunit: Remove the unused all_tests.config

In reply to David Gow

This isn't used anywhere. While it's possible that people were manually referencing it, the new default config (in default.config in the same path) provides equivalent functionality.

---
 tools/testing/kunit/configs/all_tests.config | 3 ---
 1 file changed, 3 deletions(-)
 delete mode 100644 tools/testing/kunit/configs/all_tests.config
tools/testing/kunit/configs/all_tests.config deleted +0 -3
deleted file mode 100644
index 9235b7d42d38..000000000000
@@ -1,3 +0,0 @@
-CONFIG_KUNIT=y
-CONFIG_KUNIT_TEST=y
-CONFIG_KUNIT_EXAMPLE_TEST=y
Signature · 7 lines
2.31.1.818.g46aad6cb9e-goog


_______________________________________________
linux-um mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-um