[PATCH 1/2] gpu: nova-core: add a KUnit test configuration option

Yury Norov <[email protected]>
Newsgroups org.kernel.vger.linux-kernel,dev.linux.lists.nova-gpu,org.kernel.vger.linux-doc,org.kernel.vger.linux-kselftest,org.kernel.vger.rust-for-linux
Message-ID <[email protected]>
The continuation-record KUnit tests are currently built whenever both
Nova Core and KUnit are enabled, providing no way to select the tests
independently.

Add CONFIG_NOVA_CORE_KUNIT_TEST and use it to guard the test suite.
Follow the usual KUnit convention of enabling the option through
CONFIG_KUNIT_ALL_TESTS.

Assisted-by: Codex:gpt-5.6-sol
Signed-off-by: Yury Norov <[email protected]>
---
 drivers/gpu/nova-core/Kconfig                  | 12 ++++++++++++
 drivers/gpu/nova-core/gsp/cmdq/continuation.rs |  1 +
 2 files changed, 13 insertions(+)

diff --git a/drivers/gpu/nova-core/Kconfig b/drivers/gpu/nova-core/Kconfig
index f918f69e0599..d05c2c1d46d9 100644
--- a/drivers/gpu/nova-core/Kconfig
+++ b/drivers/gpu/nova-core/Kconfig
@@ -15,3 +15,15 @@ config NOVA_CORE
 	  This driver is work in progress and may not be functional.
 
 	  If M is selected, the module will be called nova-core.
+
+config NOVA_CORE_KUNIT_TEST
+	bool "KUnit tests for Nova Core" if !KUNIT_ALL_TESTS
+	depends on NOVA_CORE && KUNIT
+	default KUNIT_ALL_TESTS
+	help
+	  This option enables KUnit tests for internal components of the Nova
+	  Core driver. The tests currently do not require GPU hardware. These
+	  are only for development and testing, not for regular kernel use
+	  cases.
+
+	  If unsure, say N.
diff --git a/drivers/gpu/nova-core/gsp/cmdq/continuation.rs b/drivers/gpu/nova-core/gsp/cmdq/continuation.rs
index 05e904f18097..c0aa16c8fbf4 100644
--- a/drivers/gpu/nova-core/gsp/cmdq/continuation.rs
+++ b/drivers/gpu/nova-core/gsp/cmdq/continuation.rs
@@ -167,6 +167,7 @@ fn init_variable_payload(
     }
 }
 
+#[cfg(CONFIG_NOVA_CORE_KUNIT_TEST)]
 #[kunit_tests(nova_core_gsp_continuation)]
 mod tests {
     use super::*;
-- 
2.53.0
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.