It would be great if there was a way to automagically run all KUnit tests.
Right now the long term solution, as suggested by Luis Chamberlain, seems to be to be to try to detect which CONFIGs enable KUnit tests and then to produce a set of .configs which when taken in sum will run all tests. However, this would likely not be as easy as it sounds as it is possible to have mutually exclusive CONFIGs. Luis pointed out that some researchers are currently working on a sat solver for Kconfig that we could use to potentially address this problem. Nevertheless, a complete solution in this regard is actually somewhat difficult.
Shuah proposed what is looking like the best short term solution: use .config fragments similar to what kselftest already does.
Most recent iteration of this discussion was brought up by Ted Ts'o here: https://groups.google.com/d/msg/kunit-dev/QmA27YEgEgI/hvS1kiz2CwAJ
Kees Cook proposed a good temporary solution (if not long term solution) in just using allyesconfig to generate a config with every test available for that architecture turned on.
His comment can be found here: https://lore.kernel.org/linux-kselftest/201910301201.404F0E3BB@keescook/
Heidi Fahim discovered that allyesconfig is broken for UML.
I tracked down all the offending configs and it appears to be quite a few:
Some of these prevent UML from building, others cause UML to crash before reaching the end of init.
One important note: It is not clear that CONFIG_NULL_TTY=y is actually broken on UML; however, it does cause the null TTY it creates to become console, which prevents UML from printing output after it is initialized.
I posted a config and script that can be used to generate an allyesconfig minus the above configs:
This has been accepted upstream: https://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest.git/commit/?h=kunit&id=021ed9f551da33449a5238e45e849913422671d7