ASoC: topology: Add explicit build option
authorMark Brown <broonie@kernel.org>
Tue, 18 Jul 2023 00:28:46 +0000 (01:28 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 18 Jul 2023 14:19:03 +0000 (15:19 +0100)
The default KUnit build options are not supposed to enable any
subsystems that were not already enabled but the topology code is a
library which is generally selected by drivers that want to use it.
Since KUnit is frequently run in virtual environments with minimal
driver support this makes it difficult to enable the toplogy tests so
provide an explicit Kconfig option which can be directly enabled when
using KUnit, and also include this in the KUnit all_tests.config.

Reviewed-by: David Gow <davidgow@google.com>
Reviewed-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20230718-asoc-topology-kunit-enable-v2-5-0ee11e662b92@kernel.org
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/Kconfig
tools/testing/kunit/configs/all_tests.config

index bfa9622e1ab1e565ee96c74381754d05ac493d92..439fa631c342ad76dbd5f4974bc28396e9863d57 100644 (file)
@@ -38,6 +38,17 @@ config SND_SOC_TOPOLOGY
        bool
        select SND_DYNAMIC_MINORS
 
+config SND_SOC_TOPOLOGY_BUILD
+       bool "Build topology core"
+       select SND_SOC_TOPOLOGY
+       depends on KUNIT
+       help
+         This option exists to facilitate running the KUnit tests for
+         the topology core, KUnit is frequently tested in virtual
+         environments with minimal drivers enabled but the topology
+         core is usually selected by drivers.  There is little reason
+         to enable it if not doing a KUnit build.
+
 config SND_SOC_TOPOLOGY_KUNIT_TEST
        tristate "KUnit tests for SoC topology"
        depends on KUNIT
index 13d15bc693fbc93b1d06e7a64494488c88a24ccc..b8adb59455ef5c97a081e1a850e9a7b705287ef6 100644 (file)
@@ -39,3 +39,4 @@ CONFIG_SECURITY_APPARMOR=y
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_SOC=y
+CONFIG_SND_SOC_TOPOLOGY_BUILD=y