tests: drivers: spi: add build all for cadence spi
As there is no currently known board that has the cadence spi,
add a test to just build it under the qemu cortex m3.
Signed-off-by: Ryan McClelland <ryanmcclelland@meta.com>
diff --git a/tests/drivers/build_all/spi/CMakeLists.txt b/tests/drivers/build_all/spi/CMakeLists.txt
new file mode 100644
index 0000000..518596a
--- /dev/null
+++ b/tests/drivers/build_all/spi/CMakeLists.txt
@@ -0,0 +1,8 @@
+# SPDX-License-Identifier: Apache-2.0
+
+cmake_minimum_required(VERSION 3.20.0)
+find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
+project(build_all)
+
+FILE(GLOB app_sources src/*.c)
+target_sources(app PRIVATE ${app_sources})
diff --git a/tests/drivers/build_all/spi/boards/qemu_cortex_m3.overlay b/tests/drivers/build_all/spi/boards/qemu_cortex_m3.overlay
new file mode 100644
index 0000000..f042d90
--- /dev/null
+++ b/tests/drivers/build_all/spi/boards/qemu_cortex_m3.overlay
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2025 Meta Platforms
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+/ {
+ spi0: spi@88888888 {
+ compatible = "cdns,spi";
+ #address-cells = <1>;
+ #size-cells = <0>;
+ reg = <0x88888888 0x400>;
+ interrupt-parent = <&nvic>;
+ interrupts = <4 1>;
+ fifo-width = <8>;
+ rx-fifo-depth = <256>;
+ tx-fifo-depth = <256>;
+ clock-frequency = <100000000>;
+ };
+};
diff --git a/tests/drivers/build_all/spi/prj.conf b/tests/drivers/build_all/spi/prj.conf
new file mode 100644
index 0000000..65c23a3
--- /dev/null
+++ b/tests/drivers/build_all/spi/prj.conf
@@ -0,0 +1,5 @@
+CONFIG_TEST=y
+CONFIG_TEST_USERSPACE=y
+CONFIG_SPI=y
+CONFIG_SPI_SLAVE=y
+CONFIG_SPI_CDNS=y
diff --git a/tests/drivers/build_all/spi/src/main.c b/tests/drivers/build_all/spi/src/main.c
new file mode 100644
index 0000000..079f009
--- /dev/null
+++ b/tests/drivers/build_all/spi/src/main.c
@@ -0,0 +1,10 @@
+/*
+ * Copyright (c) 2025 Meta Platforms
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ */
+
+int main(void)
+{
+ return 0;
+}
diff --git a/tests/drivers/build_all/spi/testcase.yaml b/tests/drivers/build_all/spi/testcase.yaml
new file mode 100644
index 0000000..5b275c6
--- /dev/null
+++ b/tests/drivers/build_all/spi/testcase.yaml
@@ -0,0 +1,11 @@
+common:
+ build_only: true
+ tags:
+ - drivers
+ - spi
+tests:
+ drivers.spi.build:
+ # will cover drivers without in-tree boards
+ platform_allow: qemu_cortex_m3
+ tags: spi_cdns
+ extra_args: "CONFIG_SPI=y"