diff mbox series

[2/2] ASoC: topology: Add explicit build option

Message ID 20230712-asoc-topology-kunit-enable-v1-2-b9f2da9dca23@kernel.org (mailing list archive)
State Superseded
Headers show
Series ASoC: Improve coverage in default KUnit runs | expand

Commit Message

Mark Brown July 12, 2023, 3:40 p.m. UTC
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.

Signed-off-by: Mark Brown <broonie@kernel.org>
---
 sound/soc/Kconfig                            | 11 +++++++++++
 tools/testing/kunit/configs/all_tests.config |  1 +
 2 files changed, 12 insertions(+)

Comments

David Gow July 13, 2023, 4:19 a.m. UTC | #1
On Wed, 12 Jul 2023 at 23:40, Mark Brown <broonie@kernel.org> wrote:
>
> 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.
>
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---

Thanks a bunch for this: the topology tests have always been some of
the most annoying to run, and this makes it so much easier.

That being said, it does still break when run with ARCH=um (see the
response to patch 1/2), so we might need to remove it from
all_tests.config or make some other changes.

Having the CONFIG_SND_SOC_TOPOLOGY_BUILD option is definitely much
better, regardless of whether it's default or not.

Reviewed-by: David Gow <davidgow@google.com>

Cheers,
-- David


>  sound/soc/Kconfig                            | 11 +++++++++++
>  tools/testing/kunit/configs/all_tests.config |  1 +
>  2 files changed, 12 insertions(+)
>
> diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
> index bfa9622e1ab1..439fa631c342 100644
> --- a/sound/soc/Kconfig
> +++ b/sound/soc/Kconfig
> @@ -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
> diff --git a/tools/testing/kunit/configs/all_tests.config b/tools/testing/kunit/configs/all_tests.config
> index 13d15bc693fb..b8adb59455ef 100644
> --- a/tools/testing/kunit/configs/all_tests.config
> +++ b/tools/testing/kunit/configs/all_tests.config
> @@ -39,3 +39,4 @@ CONFIG_SECURITY_APPARMOR=y
>  CONFIG_SOUND=y
>  CONFIG_SND=y
>  CONFIG_SND_SOC=y
> +CONFIG_SND_SOC_TOPOLOGY_BUILD=y
>
> --
> 2.39.2
>
diff mbox series

Patch

diff --git a/sound/soc/Kconfig b/sound/soc/Kconfig
index bfa9622e1ab1..439fa631c342 100644
--- a/sound/soc/Kconfig
+++ b/sound/soc/Kconfig
@@ -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
diff --git a/tools/testing/kunit/configs/all_tests.config b/tools/testing/kunit/configs/all_tests.config
index 13d15bc693fb..b8adb59455ef 100644
--- a/tools/testing/kunit/configs/all_tests.config
+++ b/tools/testing/kunit/configs/all_tests.config
@@ -39,3 +39,4 @@  CONFIG_SECURITY_APPARMOR=y
 CONFIG_SOUND=y
 CONFIG_SND=y
 CONFIG_SND_SOC=y
+CONFIG_SND_SOC_TOPOLOGY_BUILD=y