summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuval Peress <peress@google.com>2022-07-24 21:31:52 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-25 20:51:37 +0000
commitc16f255ef203b67eb31cb727a98f96e3fbce1d4b (patch)
tree7f6b5f11e5221b9588795cd56dfd6db8dad90cc9
parent3524a1f7eb23533a4a6cffd4c69bd07cf1b43129 (diff)
downloadchrome-ec-c16f255ef203b67eb31cb727a98f96e3fbce1d4b.tar.gz
zephyr: test: migrate drivers test to twister
1. Move the common test logic to drivers/common with its own CMakeLists.txt 2. Move the drivers test suites to drivers/default with its own CMakeLists.txt 3. Add a Kconfig for each suite that can enable it, use Zephyr's add_subdirectory_ifdef to control which suites get added to the biary and verify that at least 1 suite was added. 4. Add a check for ZMAKE_PROJECT_NAME to still allow zmake commands 5. Add testcase.yaml which runs all the tests BRANCH=none BUG=b:240093007 TEST=./twister --coverage -p native_posix -T zephyr/test/drivers Signed-off-by: Yuval Peress <peress@google.com> Change-Id: Ib9d4ea4a8431539391cc5349a7a8fd7a7d21f120 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3784043 Reviewed-by: Tristan Honscheid <honscheid@google.com> Commit-Queue: Tristan Honscheid <honscheid@google.com>
-rw-r--r--zephyr/CMakeLists.txt4
-rw-r--r--zephyr/test/drivers/BUILD.py2
-rw-r--r--zephyr/test/drivers/CMakeLists.txt113
-rw-r--r--zephyr/test/drivers/Kconfig25
-rw-r--r--zephyr/test/drivers/boards/native_posix.overlay (renamed from zephyr/test/drivers/overlay.dts)1
-rw-r--r--zephyr/test/drivers/common/CMakeLists.txt12
-rw-r--r--zephyr/test/drivers/common/include/test/drivers/charger_utils.h (renamed from zephyr/test/drivers/include/test/drivers/charger_utils.h)0
-rw-r--r--zephyr/test/drivers/common/include/test/drivers/stubs.h (renamed from zephyr/test/drivers/include/test/drivers/stubs.h)0
-rw-r--r--zephyr/test/drivers/common/include/test/drivers/tcpci_test_common.h (renamed from zephyr/test/drivers/include/test/drivers/tcpci_test_common.h)0
-rw-r--r--zephyr/test/drivers/common/include/test/drivers/test_mocks.h (renamed from zephyr/test/drivers/include/test/drivers/test_mocks.h)0
-rw-r--r--zephyr/test/drivers/common/include/test/drivers/test_state.h (renamed from zephyr/test/drivers/include/test/drivers/test_state.h)0
-rw-r--r--zephyr/test/drivers/common/include/test/drivers/utils.h (renamed from zephyr/test/drivers/include/test/drivers/utils.h)0
-rw-r--r--zephyr/test/drivers/common/src/main.c (renamed from zephyr/test/drivers/src/main.c)0
-rw-r--r--zephyr/test/drivers/common/src/stubs.c (renamed from zephyr/test/drivers/src/stubs.c)0
-rw-r--r--zephyr/test/drivers/common/src/test_mocks.c (renamed from zephyr/test/drivers/src/test_mocks.c)0
-rw-r--r--zephyr/test/drivers/common/src/test_rules.c (renamed from zephyr/test/drivers/src/test_rules.c)0
-rw-r--r--zephyr/test/drivers/common/src/utils.c (renamed from zephyr/test/drivers/src/utils.c)0
-rw-r--r--zephyr/test/drivers/default/CMakeLists.txt55
-rw-r--r--zephyr/test/drivers/default/src/battery.c (renamed from zephyr/test/drivers/src/battery.c)0
-rw-r--r--zephyr/test/drivers/default/src/bb_retimer.c (renamed from zephyr/test/drivers/src/bb_retimer.c)0
-rw-r--r--zephyr/test/drivers/default/src/bc12.c (renamed from zephyr/test/drivers/src/bc12.c)0
-rw-r--r--zephyr/test/drivers/default/src/bma2x2.c (renamed from zephyr/test/drivers/src/bma2x2.c)0
-rw-r--r--zephyr/test/drivers/default/src/bmi160.c (renamed from zephyr/test/drivers/src/bmi160.c)0
-rw-r--r--zephyr/test/drivers/default/src/bmi260.c (renamed from zephyr/test/drivers/src/bmi260.c)0
-rw-r--r--zephyr/test/drivers/default/src/charge_manager.c (renamed from zephyr/test/drivers/src/charge_manager.c)0
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/accelinfo.c (renamed from zephyr/test/drivers/src/console_cmd/accelinfo.c)0
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/accelinit.c (renamed from zephyr/test/drivers/src/console_cmd/accelinit.c)0
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/accelrange.c (renamed from zephyr/test/drivers/src/console_cmd/accelrange.c)0
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/accelrate.c (renamed from zephyr/test/drivers/src/console_cmd/accelrate.c)0
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/accelread.c (renamed from zephyr/test/drivers/src/console_cmd/accelread.c)0
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/accelres.c (renamed from zephyr/test/drivers/src/console_cmd/accelres.c)0
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/accelspoof.c (renamed from zephyr/test/drivers/src/console_cmd/accelspoof.c)0
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/charge_manager.c (renamed from zephyr/test/drivers/src/console_cmd/charge_manager.c)0
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/charge_state.c (renamed from zephyr/test/drivers/src/console_cmd/charge_state.c)0
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/usb_pd_console.c (renamed from zephyr/test/drivers/src/console_cmd/usb_pd_console.c)0
-rw-r--r--zephyr/test/drivers/default/src/cros_cbi.c (renamed from zephyr/test/drivers/src/cros_cbi.c)0
-rw-r--r--zephyr/test/drivers/default/src/espi.c (renamed from zephyr/test/drivers/src/espi.c)0
-rw-r--r--zephyr/test/drivers/default/src/gpio.c (renamed from zephyr/test/drivers/src/gpio.c)0
-rw-r--r--zephyr/test/drivers/default/src/host_cmd/host_event_commands.c (renamed from zephyr/test/drivers/src/host_cmd/host_event_commands.c)0
-rw-r--r--zephyr/test/drivers/default/src/host_cmd/motion_sense.c (renamed from zephyr/test/drivers/src/host_cmd/motion_sense.c)0
-rw-r--r--zephyr/test/drivers/default/src/i2c_passthru.c (renamed from zephyr/test/drivers/src/i2c_passthru.c)0
-rw-r--r--zephyr/test/drivers/default/src/integration/usbc/usb.c (renamed from zephyr/test/drivers/src/integration/usbc/usb.c)0
-rw-r--r--zephyr/test/drivers/default/src/integration/usbc/usb_20v_3a_pd_charger.c (renamed from zephyr/test/drivers/src/integration/usbc/usb_20v_3a_pd_charger.c)0
-rw-r--r--zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_sink.c (renamed from zephyr/test/drivers/src/integration/usbc/usb_5v_3a_pd_sink.c)0
-rw-r--r--zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_source.c (renamed from zephyr/test/drivers/src/integration/usbc/usb_5v_3a_pd_source.c)0
-rw-r--r--zephyr/test/drivers/default/src/integration/usbc/usb_attach_src_snk.c (renamed from zephyr/test/drivers/src/integration/usbc/usb_attach_src_snk.c)0
-rw-r--r--zephyr/test/drivers/default/src/integration/usbc/usb_pd_ctrl_msg.c (renamed from zephyr/test/drivers/src/integration/usbc/usb_pd_ctrl_msg.c)0
-rw-r--r--zephyr/test/drivers/default/src/integration/usbc/usb_pd_rev3.c (renamed from zephyr/test/drivers/src/integration/usbc/usb_pd_rev3.c)0
-rw-r--r--zephyr/test/drivers/default/src/isl923x.c (renamed from zephyr/test/drivers/src/isl923x.c)0
-rw-r--r--zephyr/test/drivers/default/src/keyboard_scan.c (renamed from zephyr/test/drivers/src/keyboard_scan.c)0
-rw-r--r--zephyr/test/drivers/default/src/lid_switch.c (renamed from zephyr/test/drivers/src/lid_switch.c)0
-rw-r--r--zephyr/test/drivers/default/src/lis2dw12.c (renamed from zephyr/test/drivers/src/lis2dw12.c)0
-rw-r--r--zephyr/test/drivers/default/src/ln9310.c (renamed from zephyr/test/drivers/src/ln9310.c)0
-rw-r--r--zephyr/test/drivers/default/src/motion_sense/motion_sense.c (renamed from zephyr/test/drivers/src/motion_sense/motion_sense.c)0
-rw-r--r--zephyr/test/drivers/default/src/panic.c (renamed from zephyr/test/drivers/src/panic.c)0
-rw-r--r--zephyr/test/drivers/default/src/power_common.c (renamed from zephyr/test/drivers/src/power_common.c)0
-rw-r--r--zephyr/test/drivers/default/src/ppc_sn5s330.c (renamed from zephyr/test/drivers/src/ppc_sn5s330.c)0
-rw-r--r--zephyr/test/drivers/default/src/ppc_syv682x.c (renamed from zephyr/test/drivers/src/ppc_syv682x.c)0
-rw-r--r--zephyr/test/drivers/default/src/ps8xxx.c (renamed from zephyr/test/drivers/src/ps8xxx.c)0
-rw-r--r--zephyr/test/drivers/default/src/smart.c (renamed from zephyr/test/drivers/src/smart.c)0
-rw-r--r--zephyr/test/drivers/default/src/stm_mems_common.c (renamed from zephyr/test/drivers/src/stm_mems_common.c)0
-rw-r--r--zephyr/test/drivers/default/src/tcpci.c (renamed from zephyr/test/drivers/src/tcpci.c)0
-rw-r--r--zephyr/test/drivers/default/src/tcpci_test_common.c (renamed from zephyr/test/drivers/src/tcpci_test_common.c)0
-rw-r--r--zephyr/test/drivers/default/src/tcs3400.c (renamed from zephyr/test/drivers/src/tcs3400.c)0
-rw-r--r--zephyr/test/drivers/default/src/temp_sensor.c (renamed from zephyr/test/drivers/src/temp_sensor.c)0
-rw-r--r--zephyr/test/drivers/default/src/thermistor.c (renamed from zephyr/test/drivers/src/thermistor.c)0
-rw-r--r--zephyr/test/drivers/default/src/uart_hostcmd.c (renamed from zephyr/test/drivers/src/uart_hostcmd.c)0
-rw-r--r--zephyr/test/drivers/default/src/usb_mux.c (renamed from zephyr/test/drivers/src/usb_mux.c)0
-rw-r--r--zephyr/test/drivers/default/src/usb_pd_host_cmd.c (renamed from zephyr/test/drivers/src/usb_pd_host_cmd.c)0
-rw-r--r--zephyr/test/drivers/default/src/vboot_hash.c (renamed from zephyr/test/drivers/src/vboot_hash.c)0
-rw-r--r--zephyr/test/drivers/default/src/watchdog.c (renamed from zephyr/test/drivers/src/watchdog.c)0
-rw-r--r--zephyr/test/drivers/testcase.yaml24
72 files changed, 153 insertions, 83 deletions
diff --git a/zephyr/CMakeLists.txt b/zephyr/CMakeLists.txt
index 8e42570a6f..dfa40d4891 100644
--- a/zephyr/CMakeLists.txt
+++ b/zephyr/CMakeLists.txt
@@ -92,12 +92,12 @@ set(ZEPHYR_CURRENT_LIBRARY app)
# Custom function that ensures the include path is always updated for both
# libraries.
function(cros_ec_library_include_directories)
- target_include_directories(app PRIVATE ${ARGN})
+ target_include_directories(app PUBLIC ${ARGN})
target_include_directories(ec_shim PRIVATE ${ARGN})
endfunction()
function(cros_ec_library_include_directories_ifdef feature_toggle)
if(${${feature_toggle}})
- target_include_directories(app PRIVATE ${ARGN})
+ target_include_directories(app PUBLIC ${ARGN})
target_include_directories(ec_shim PRIVATE ${ARGN})
endif()
endfunction()
diff --git a/zephyr/test/drivers/BUILD.py b/zephyr/test/drivers/BUILD.py
index 159e0d2e0c..55ce254650 100644
--- a/zephyr/test/drivers/BUILD.py
+++ b/zephyr/test/drivers/BUILD.py
@@ -8,7 +8,7 @@
drivers = register_host_test(
test_name="drivers",
dts_overlays=[
- here / "overlay.dts",
+ here / "boards/native_posix.overlay",
],
kconfig_files=[
here / "prj.conf",
diff --git a/zephyr/test/drivers/CMakeLists.txt b/zephyr/test/drivers/CMakeLists.txt
index 1db421dd7b..81b43bf6d2 100644
--- a/zephyr/test/drivers/CMakeLists.txt
+++ b/zephyr/test/drivers/CMakeLists.txt
@@ -4,87 +4,50 @@
cmake_minimum_required(VERSION 3.13.1)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
-project(${ZMAKE_PROJECT_NAME})
+project(drivers)
-target_include_directories(app PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}/include
- "${PLATFORM_EC}/driver/ppc/")
+add_subdirectory(common)
-# Common sources
-target_sources(app PRIVATE
- src/main.c
- src/test_mocks.c
- src/test_rules.c
- src/utils.c
- src/stubs.c
-)
+get_target_property(TEST_SOURCES app SOURCES)
-if(NOT ZMAKE_PROJECT_NAME MATCHES "^test-drivers.*")
- message(FATAL "Invalid project name")
+# Support zmake for now
+if("${ZMAKE_PROJECT_NAME}" STREQUAL "test-drivers")
+ set(CONFIG_LINK_TEST_SUITE_DEFAULT TRUE)
+ set(CONFIG_LINK_TEST_SUITE_USB_MALFUNCTION_SINK TRUE)
+ add_compile_definitions(CONFIG_LINK_TEST_SUITE_DEFAULT=1)
+ add_compile_definitions(CONFIG_LINK_TEST_SUITE_USB_MALFUNCTION_SINK=1)
+elseif("${ZMAKE_PROJECT_NAME}" STREQUAL "test-drivers-ap_mux_control")
+ set(CONFIG_LINK_TEST_SUITE_AP_MUX_CONTROL TRUE)
+ add_compile_definitions(CONFIG_LINK_TEST_SUITE_AP_MUX_CONTROL=1)
+elseif("${ZMAKE_PROJECT_NAME}" STREQUAL "test-drivers-chargesplash")
+ set(CONFIG_LINK_TEST_SUITE_CHARGESPLASH TRUE)
+ add_compile_definitions(CONFIG_LINK_TEST_SUITE_CHARGESPLASH=1)
+elseif("${ZMAKE_PROJECT_NAME}" STREQUAL "test-drivers-isl923x")
+ set(CONFIG_LINK_TEST_SUITE_ISL923X TRUE)
+ add_compile_definitions(CONFIG_LINK_TEST_SUITE_ISL923X=1)
+elseif("${ZMAKE_PROJECT_NAME}" STREQUAL "test-drivers-led_driver")
+ set(CONFIG_LINK_TEST_SUITE_LED_DRIVER TRUE)
+ add_compile_definitions(CONFIG_LINK_TEST_SUITE_LED_DRIVER=1)
+elseif("${ZMAKE_PROJECT_NAME}" STREQUAL "test-drivers-usbc_alt_mode")
+ set(CONFIG_LINK_TEST_SUITE_USBC_ALT_MODE TRUE)
+ add_compile_definitions(CONFIG_LINK_TEST_SUITE_USBC_ALT_MODE=1)
endif()
-string(SUBSTRING "${ZMAKE_PROJECT_NAME}" 12 -1 subproject_path)
-string(REPLACE "-" "/" subproject_path "${subproject_path}")
-if(subproject_path STREQUAL "")
- target_sources(app PRIVATE
- src/battery.c
- src/bb_retimer.c
- src/bc12.c
- src/bma2x2.c
- src/bmi160.c
- src/bmi260.c
- src/charge_manager.c
- src/console_cmd/charge_manager.c
- src/console_cmd/charge_state.c
- src/console_cmd/accelinit.c
- src/console_cmd/accelinfo.c
- src/console_cmd/accelspoof.c
- src/console_cmd/accelrate.c
- src/console_cmd/accelrange.c
- src/console_cmd/accelread.c
- src/console_cmd/accelres.c
- src/console_cmd/usb_pd_console.c
- src/cros_cbi.c
- src/espi.c
- src/gpio.c
- src/host_cmd/host_event_commands.c
- src/host_cmd/motion_sense.c
- src/integration/usbc/usb.c
- src/integration/usbc/usb_20v_3a_pd_charger.c
- src/integration/usbc/usb_5v_3a_pd_sink.c
- src/integration/usbc/usb_5v_3a_pd_source.c
- src/integration/usbc/usb_attach_src_snk.c
- src/integration/usbc/usb_pd_ctrl_msg.c
- src/integration/usbc/usb_pd_rev3.c
- src/i2c_passthru.c
- src/isl923x.c
- src/keyboard_scan.c
- src/lid_switch.c
- src/lis2dw12.c
- src/ln9310.c
- src/motion_sense/motion_sense.c
- src/panic.c
- src/power_common.c
- src/ppc_sn5s330.c
- src/ppc_syv682x.c
- src/ps8xxx.c
- src/smart.c
- src/stm_mems_common.c
- src/tcpci.c
- src/tcpci_test_common.c
- src/tcs3400.c
- src/temp_sensor.c
- src/thermistor.c
- src/uart_hostcmd.c
- src/usb_mux.c
- src/usb_pd_host_cmd.c
- src/vboot_hash.c
- src/watchdog.c
- )
+# Add linked suites here
+add_subdirectory_ifdef(CONFIG_LINK_TEST_SUITE_DEFAULT default)
+add_subdirectory_ifdef(CONFIG_LINK_TEST_SUITE_AP_MUX_CONTROL ap_mux_control)
+add_subdirectory_ifdef(CONFIG_LINK_TEST_SUITE_CHARGESPLASH chargesplash)
+add_subdirectory_ifdef(CONFIG_LINK_TEST_SUITE_ISL923X isl923x)
+add_subdirectory_ifdef(CONFIG_LINK_TEST_SUITE_LED_DRIVER led_driver)
+add_subdirectory_ifdef(CONFIG_LINK_TEST_SUITE_USB_MALFUNCTION_SINK usb_malfunction_sink)
+add_subdirectory_ifdef(CONFIG_LINK_TEST_SUITE_USBC_ALT_MODE usbc_alt_mode)
- add_subdirectory(usb_malfunction_sink)
-else()
- add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}${subproject_path})
+get_target_property(TEST_SOURCES_NEW app SOURCES)
+
+# Check to make sure at least one suite was added
+list(REMOVE_ITEM TEST_SOURCES_NEW ${TEST_SOURCES})
+if(NOT TEST_SOURCES_NEW)
+ message(FATAL_ERROR "Invalid configuration, must add test sources")
endif()
set_compiler_property(APPEND PROPERTY coverage -O0)
diff --git a/zephyr/test/drivers/Kconfig b/zephyr/test/drivers/Kconfig
index 6e57a22c1f..d3fc101968 100644
--- a/zephyr/test/drivers/Kconfig
+++ b/zephyr/test/drivers/Kconfig
@@ -2,10 +2,25 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
-config BUG209907615
- bool "Enable tests for b:209907615"
- help
- This flag may change as we protoype integration tests.
- TODO(b/209907615): Remove when test finished.
+config LINK_TEST_SUITE_DEFAULT
+ bool "Link and test the default test suite"
+
+config LINK_TEST_SUITE_AP_MUX_CONTROL
+ bool "Link and test the ap_mux_control tests"
+
+config LINK_TEST_SUITE_CHARGESPLASH
+ bool "Link and test the chargesplash tests"
+
+config LINK_TEST_SUITE_ISL923X
+ bool "Link and test the isl923x tests"
+
+config LINK_TEST_SUITE_LED_DRIVER
+ bool "Link and test the led_driver tests"
+
+config LINK_TEST_SUITE_USB_MALFUNCTION_SINK
+ bool "Link and test the usb_malfunction_sink tests"
+
+config LINK_TEST_SUITE_USBC_ALT_MODE
+ bool "Link and test the usbc_alt_mode tests"
source "Kconfig.zephyr"
diff --git a/zephyr/test/drivers/overlay.dts b/zephyr/test/drivers/boards/native_posix.overlay
index d7eaaf1116..622f9b4407 100644
--- a/zephyr/test/drivers/overlay.dts
+++ b/zephyr/test/drivers/boards/native_posix.overlay
@@ -3,6 +3,7 @@
* found in the LICENSE file.
*/
+#include <board-overlays/native_posix.dts>
#include <cros/binman.dtsi>
#include <cros/thermistor/thermistor.dtsi>
#include <dt-bindings/gpio_defines.h>
diff --git a/zephyr/test/drivers/common/CMakeLists.txt b/zephyr/test/drivers/common/CMakeLists.txt
new file mode 100644
index 0000000000..965c58e7f8
--- /dev/null
+++ b/zephyr/test/drivers/common/CMakeLists.txt
@@ -0,0 +1,12 @@
+# Common sources
+target_sources(app PRIVATE
+ src/main.c
+ src/test_mocks.c
+ src/test_rules.c
+ src/utils.c
+ src/stubs.c
+)
+target_include_directories(app PRIVATE
+ ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${PLATFORM_EC}/driver/ppc/
+) \ No newline at end of file
diff --git a/zephyr/test/drivers/include/test/drivers/charger_utils.h b/zephyr/test/drivers/common/include/test/drivers/charger_utils.h
index 1712a5a384..1712a5a384 100644
--- a/zephyr/test/drivers/include/test/drivers/charger_utils.h
+++ b/zephyr/test/drivers/common/include/test/drivers/charger_utils.h
diff --git a/zephyr/test/drivers/include/test/drivers/stubs.h b/zephyr/test/drivers/common/include/test/drivers/stubs.h
index 2e03142d72..2e03142d72 100644
--- a/zephyr/test/drivers/include/test/drivers/stubs.h
+++ b/zephyr/test/drivers/common/include/test/drivers/stubs.h
diff --git a/zephyr/test/drivers/include/test/drivers/tcpci_test_common.h b/zephyr/test/drivers/common/include/test/drivers/tcpci_test_common.h
index a291e8162c..a291e8162c 100644
--- a/zephyr/test/drivers/include/test/drivers/tcpci_test_common.h
+++ b/zephyr/test/drivers/common/include/test/drivers/tcpci_test_common.h
diff --git a/zephyr/test/drivers/include/test/drivers/test_mocks.h b/zephyr/test/drivers/common/include/test/drivers/test_mocks.h
index 815d8c3740..815d8c3740 100644
--- a/zephyr/test/drivers/include/test/drivers/test_mocks.h
+++ b/zephyr/test/drivers/common/include/test/drivers/test_mocks.h
diff --git a/zephyr/test/drivers/include/test/drivers/test_state.h b/zephyr/test/drivers/common/include/test/drivers/test_state.h
index fe8b3e8ffc..fe8b3e8ffc 100644
--- a/zephyr/test/drivers/include/test/drivers/test_state.h
+++ b/zephyr/test/drivers/common/include/test/drivers/test_state.h
diff --git a/zephyr/test/drivers/include/test/drivers/utils.h b/zephyr/test/drivers/common/include/test/drivers/utils.h
index b7fd6ebb86..b7fd6ebb86 100644
--- a/zephyr/test/drivers/include/test/drivers/utils.h
+++ b/zephyr/test/drivers/common/include/test/drivers/utils.h
diff --git a/zephyr/test/drivers/src/main.c b/zephyr/test/drivers/common/src/main.c
index 319d42e3ad..319d42e3ad 100644
--- a/zephyr/test/drivers/src/main.c
+++ b/zephyr/test/drivers/common/src/main.c
diff --git a/zephyr/test/drivers/src/stubs.c b/zephyr/test/drivers/common/src/stubs.c
index bc6c526108..bc6c526108 100644
--- a/zephyr/test/drivers/src/stubs.c
+++ b/zephyr/test/drivers/common/src/stubs.c
diff --git a/zephyr/test/drivers/src/test_mocks.c b/zephyr/test/drivers/common/src/test_mocks.c
index f8bbb1a6c1..f8bbb1a6c1 100644
--- a/zephyr/test/drivers/src/test_mocks.c
+++ b/zephyr/test/drivers/common/src/test_mocks.c
diff --git a/zephyr/test/drivers/src/test_rules.c b/zephyr/test/drivers/common/src/test_rules.c
index 5125f50d58..5125f50d58 100644
--- a/zephyr/test/drivers/src/test_rules.c
+++ b/zephyr/test/drivers/common/src/test_rules.c
diff --git a/zephyr/test/drivers/src/utils.c b/zephyr/test/drivers/common/src/utils.c
index ba27eb7095..ba27eb7095 100644
--- a/zephyr/test/drivers/src/utils.c
+++ b/zephyr/test/drivers/common/src/utils.c
diff --git a/zephyr/test/drivers/default/CMakeLists.txt b/zephyr/test/drivers/default/CMakeLists.txt
new file mode 100644
index 0000000000..bb964a954e
--- /dev/null
+++ b/zephyr/test/drivers/default/CMakeLists.txt
@@ -0,0 +1,55 @@
+target_sources(app PRIVATE
+ src/battery.c
+ src/bb_retimer.c
+ src/bc12.c
+ src/bma2x2.c
+ src/bmi160.c
+ src/bmi260.c
+ src/charge_manager.c
+ src/console_cmd/charge_manager.c
+ src/console_cmd/charge_state.c
+ src/console_cmd/accelinit.c
+ src/console_cmd/accelinfo.c
+ src/console_cmd/accelspoof.c
+ src/console_cmd/accelrate.c
+ src/console_cmd/accelrange.c
+ src/console_cmd/accelread.c
+ src/console_cmd/accelres.c
+ src/console_cmd/usb_pd_console.c
+ src/cros_cbi.c
+ src/espi.c
+ src/gpio.c
+ src/host_cmd/host_event_commands.c
+ src/host_cmd/motion_sense.c
+ src/integration/usbc/usb.c
+ src/integration/usbc/usb_20v_3a_pd_charger.c
+ src/integration/usbc/usb_5v_3a_pd_sink.c
+ src/integration/usbc/usb_5v_3a_pd_source.c
+ src/integration/usbc/usb_attach_src_snk.c
+ src/integration/usbc/usb_pd_ctrl_msg.c
+ src/integration/usbc/usb_pd_rev3.c
+ src/i2c_passthru.c
+ src/isl923x.c
+ src/keyboard_scan.c
+ src/lid_switch.c
+ src/lis2dw12.c
+ src/ln9310.c
+ src/motion_sense/motion_sense.c
+ src/panic.c
+ src/power_common.c
+ src/ppc_sn5s330.c
+ src/ppc_syv682x.c
+ src/ps8xxx.c
+ src/smart.c
+ src/stm_mems_common.c
+ src/tcpci.c
+ src/tcpci_test_common.c
+ src/tcs3400.c
+ src/temp_sensor.c
+ src/thermistor.c
+ src/uart_hostcmd.c
+ src/usb_mux.c
+ src/usb_pd_host_cmd.c
+ src/vboot_hash.c
+ src/watchdog.c
+)
diff --git a/zephyr/test/drivers/src/battery.c b/zephyr/test/drivers/default/src/battery.c
index e454262aa2..e454262aa2 100644
--- a/zephyr/test/drivers/src/battery.c
+++ b/zephyr/test/drivers/default/src/battery.c
diff --git a/zephyr/test/drivers/src/bb_retimer.c b/zephyr/test/drivers/default/src/bb_retimer.c
index a9db2eb052..a9db2eb052 100644
--- a/zephyr/test/drivers/src/bb_retimer.c
+++ b/zephyr/test/drivers/default/src/bb_retimer.c
diff --git a/zephyr/test/drivers/src/bc12.c b/zephyr/test/drivers/default/src/bc12.c
index ac1c5692d1..ac1c5692d1 100644
--- a/zephyr/test/drivers/src/bc12.c
+++ b/zephyr/test/drivers/default/src/bc12.c
diff --git a/zephyr/test/drivers/src/bma2x2.c b/zephyr/test/drivers/default/src/bma2x2.c
index e04e402af1..e04e402af1 100644
--- a/zephyr/test/drivers/src/bma2x2.c
+++ b/zephyr/test/drivers/default/src/bma2x2.c
diff --git a/zephyr/test/drivers/src/bmi160.c b/zephyr/test/drivers/default/src/bmi160.c
index 39144bd9e6..39144bd9e6 100644
--- a/zephyr/test/drivers/src/bmi160.c
+++ b/zephyr/test/drivers/default/src/bmi160.c
diff --git a/zephyr/test/drivers/src/bmi260.c b/zephyr/test/drivers/default/src/bmi260.c
index a4c713a7fb..a4c713a7fb 100644
--- a/zephyr/test/drivers/src/bmi260.c
+++ b/zephyr/test/drivers/default/src/bmi260.c
diff --git a/zephyr/test/drivers/src/charge_manager.c b/zephyr/test/drivers/default/src/charge_manager.c
index 13668924fd..13668924fd 100644
--- a/zephyr/test/drivers/src/charge_manager.c
+++ b/zephyr/test/drivers/default/src/charge_manager.c
diff --git a/zephyr/test/drivers/src/console_cmd/accelinfo.c b/zephyr/test/drivers/default/src/console_cmd/accelinfo.c
index e60d00b596..e60d00b596 100644
--- a/zephyr/test/drivers/src/console_cmd/accelinfo.c
+++ b/zephyr/test/drivers/default/src/console_cmd/accelinfo.c
diff --git a/zephyr/test/drivers/src/console_cmd/accelinit.c b/zephyr/test/drivers/default/src/console_cmd/accelinit.c
index f6e2a4ae38..f6e2a4ae38 100644
--- a/zephyr/test/drivers/src/console_cmd/accelinit.c
+++ b/zephyr/test/drivers/default/src/console_cmd/accelinit.c
diff --git a/zephyr/test/drivers/src/console_cmd/accelrange.c b/zephyr/test/drivers/default/src/console_cmd/accelrange.c
index b78702e486..b78702e486 100644
--- a/zephyr/test/drivers/src/console_cmd/accelrange.c
+++ b/zephyr/test/drivers/default/src/console_cmd/accelrange.c
diff --git a/zephyr/test/drivers/src/console_cmd/accelrate.c b/zephyr/test/drivers/default/src/console_cmd/accelrate.c
index 6ae4b96343..6ae4b96343 100644
--- a/zephyr/test/drivers/src/console_cmd/accelrate.c
+++ b/zephyr/test/drivers/default/src/console_cmd/accelrate.c
diff --git a/zephyr/test/drivers/src/console_cmd/accelread.c b/zephyr/test/drivers/default/src/console_cmd/accelread.c
index 1dcc4168a4..1dcc4168a4 100644
--- a/zephyr/test/drivers/src/console_cmd/accelread.c
+++ b/zephyr/test/drivers/default/src/console_cmd/accelread.c
diff --git a/zephyr/test/drivers/src/console_cmd/accelres.c b/zephyr/test/drivers/default/src/console_cmd/accelres.c
index 62aebf51dd..62aebf51dd 100644
--- a/zephyr/test/drivers/src/console_cmd/accelres.c
+++ b/zephyr/test/drivers/default/src/console_cmd/accelres.c
diff --git a/zephyr/test/drivers/src/console_cmd/accelspoof.c b/zephyr/test/drivers/default/src/console_cmd/accelspoof.c
index 2d9887a2ab..2d9887a2ab 100644
--- a/zephyr/test/drivers/src/console_cmd/accelspoof.c
+++ b/zephyr/test/drivers/default/src/console_cmd/accelspoof.c
diff --git a/zephyr/test/drivers/src/console_cmd/charge_manager.c b/zephyr/test/drivers/default/src/console_cmd/charge_manager.c
index e604570443..e604570443 100644
--- a/zephyr/test/drivers/src/console_cmd/charge_manager.c
+++ b/zephyr/test/drivers/default/src/console_cmd/charge_manager.c
diff --git a/zephyr/test/drivers/src/console_cmd/charge_state.c b/zephyr/test/drivers/default/src/console_cmd/charge_state.c
index 384e7d84e3..384e7d84e3 100644
--- a/zephyr/test/drivers/src/console_cmd/charge_state.c
+++ b/zephyr/test/drivers/default/src/console_cmd/charge_state.c
diff --git a/zephyr/test/drivers/src/console_cmd/usb_pd_console.c b/zephyr/test/drivers/default/src/console_cmd/usb_pd_console.c
index 36f3402378..36f3402378 100644
--- a/zephyr/test/drivers/src/console_cmd/usb_pd_console.c
+++ b/zephyr/test/drivers/default/src/console_cmd/usb_pd_console.c
diff --git a/zephyr/test/drivers/src/cros_cbi.c b/zephyr/test/drivers/default/src/cros_cbi.c
index d0afdaecdb..d0afdaecdb 100644
--- a/zephyr/test/drivers/src/cros_cbi.c
+++ b/zephyr/test/drivers/default/src/cros_cbi.c
diff --git a/zephyr/test/drivers/src/espi.c b/zephyr/test/drivers/default/src/espi.c
index f0e7a1e9e3..f0e7a1e9e3 100644
--- a/zephyr/test/drivers/src/espi.c
+++ b/zephyr/test/drivers/default/src/espi.c
diff --git a/zephyr/test/drivers/src/gpio.c b/zephyr/test/drivers/default/src/gpio.c
index 8686eee9c1..8686eee9c1 100644
--- a/zephyr/test/drivers/src/gpio.c
+++ b/zephyr/test/drivers/default/src/gpio.c
diff --git a/zephyr/test/drivers/src/host_cmd/host_event_commands.c b/zephyr/test/drivers/default/src/host_cmd/host_event_commands.c
index 8efcd6b302..8efcd6b302 100644
--- a/zephyr/test/drivers/src/host_cmd/host_event_commands.c
+++ b/zephyr/test/drivers/default/src/host_cmd/host_event_commands.c
diff --git a/zephyr/test/drivers/src/host_cmd/motion_sense.c b/zephyr/test/drivers/default/src/host_cmd/motion_sense.c
index accc4193e0..accc4193e0 100644
--- a/zephyr/test/drivers/src/host_cmd/motion_sense.c
+++ b/zephyr/test/drivers/default/src/host_cmd/motion_sense.c
diff --git a/zephyr/test/drivers/src/i2c_passthru.c b/zephyr/test/drivers/default/src/i2c_passthru.c
index bab6a15b28..bab6a15b28 100644
--- a/zephyr/test/drivers/src/i2c_passthru.c
+++ b/zephyr/test/drivers/default/src/i2c_passthru.c
diff --git a/zephyr/test/drivers/src/integration/usbc/usb.c b/zephyr/test/drivers/default/src/integration/usbc/usb.c
index 4b8cd2fe11..4b8cd2fe11 100644
--- a/zephyr/test/drivers/src/integration/usbc/usb.c
+++ b/zephyr/test/drivers/default/src/integration/usbc/usb.c
diff --git a/zephyr/test/drivers/src/integration/usbc/usb_20v_3a_pd_charger.c b/zephyr/test/drivers/default/src/integration/usbc/usb_20v_3a_pd_charger.c
index afd6e5aebc..afd6e5aebc 100644
--- a/zephyr/test/drivers/src/integration/usbc/usb_20v_3a_pd_charger.c
+++ b/zephyr/test/drivers/default/src/integration/usbc/usb_20v_3a_pd_charger.c
diff --git a/zephyr/test/drivers/src/integration/usbc/usb_5v_3a_pd_sink.c b/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_sink.c
index 278a6508da..278a6508da 100644
--- a/zephyr/test/drivers/src/integration/usbc/usb_5v_3a_pd_sink.c
+++ b/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_sink.c
diff --git a/zephyr/test/drivers/src/integration/usbc/usb_5v_3a_pd_source.c b/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_source.c
index 2139c75af1..2139c75af1 100644
--- a/zephyr/test/drivers/src/integration/usbc/usb_5v_3a_pd_source.c
+++ b/zephyr/test/drivers/default/src/integration/usbc/usb_5v_3a_pd_source.c
diff --git a/zephyr/test/drivers/src/integration/usbc/usb_attach_src_snk.c b/zephyr/test/drivers/default/src/integration/usbc/usb_attach_src_snk.c
index 5205952522..5205952522 100644
--- a/zephyr/test/drivers/src/integration/usbc/usb_attach_src_snk.c
+++ b/zephyr/test/drivers/default/src/integration/usbc/usb_attach_src_snk.c
diff --git a/zephyr/test/drivers/src/integration/usbc/usb_pd_ctrl_msg.c b/zephyr/test/drivers/default/src/integration/usbc/usb_pd_ctrl_msg.c
index a68afd85d2..a68afd85d2 100644
--- a/zephyr/test/drivers/src/integration/usbc/usb_pd_ctrl_msg.c
+++ b/zephyr/test/drivers/default/src/integration/usbc/usb_pd_ctrl_msg.c
diff --git a/zephyr/test/drivers/src/integration/usbc/usb_pd_rev3.c b/zephyr/test/drivers/default/src/integration/usbc/usb_pd_rev3.c
index b18d443cab..b18d443cab 100644
--- a/zephyr/test/drivers/src/integration/usbc/usb_pd_rev3.c
+++ b/zephyr/test/drivers/default/src/integration/usbc/usb_pd_rev3.c
diff --git a/zephyr/test/drivers/src/isl923x.c b/zephyr/test/drivers/default/src/isl923x.c
index 321845ea04..321845ea04 100644
--- a/zephyr/test/drivers/src/isl923x.c
+++ b/zephyr/test/drivers/default/src/isl923x.c
diff --git a/zephyr/test/drivers/src/keyboard_scan.c b/zephyr/test/drivers/default/src/keyboard_scan.c
index 7f1c860ad5..7f1c860ad5 100644
--- a/zephyr/test/drivers/src/keyboard_scan.c
+++ b/zephyr/test/drivers/default/src/keyboard_scan.c
diff --git a/zephyr/test/drivers/src/lid_switch.c b/zephyr/test/drivers/default/src/lid_switch.c
index 42d91495f4..42d91495f4 100644
--- a/zephyr/test/drivers/src/lid_switch.c
+++ b/zephyr/test/drivers/default/src/lid_switch.c
diff --git a/zephyr/test/drivers/src/lis2dw12.c b/zephyr/test/drivers/default/src/lis2dw12.c
index 5def699088..5def699088 100644
--- a/zephyr/test/drivers/src/lis2dw12.c
+++ b/zephyr/test/drivers/default/src/lis2dw12.c
diff --git a/zephyr/test/drivers/src/ln9310.c b/zephyr/test/drivers/default/src/ln9310.c
index e83e2df0a5..e83e2df0a5 100644
--- a/zephyr/test/drivers/src/ln9310.c
+++ b/zephyr/test/drivers/default/src/ln9310.c
diff --git a/zephyr/test/drivers/src/motion_sense/motion_sense.c b/zephyr/test/drivers/default/src/motion_sense/motion_sense.c
index 5b6839bbae..5b6839bbae 100644
--- a/zephyr/test/drivers/src/motion_sense/motion_sense.c
+++ b/zephyr/test/drivers/default/src/motion_sense/motion_sense.c
diff --git a/zephyr/test/drivers/src/panic.c b/zephyr/test/drivers/default/src/panic.c
index 2ee12b34c3..2ee12b34c3 100644
--- a/zephyr/test/drivers/src/panic.c
+++ b/zephyr/test/drivers/default/src/panic.c
diff --git a/zephyr/test/drivers/src/power_common.c b/zephyr/test/drivers/default/src/power_common.c
index 2d61ecf333..2d61ecf333 100644
--- a/zephyr/test/drivers/src/power_common.c
+++ b/zephyr/test/drivers/default/src/power_common.c
diff --git a/zephyr/test/drivers/src/ppc_sn5s330.c b/zephyr/test/drivers/default/src/ppc_sn5s330.c
index bc81ed3c5b..bc81ed3c5b 100644
--- a/zephyr/test/drivers/src/ppc_sn5s330.c
+++ b/zephyr/test/drivers/default/src/ppc_sn5s330.c
diff --git a/zephyr/test/drivers/src/ppc_syv682x.c b/zephyr/test/drivers/default/src/ppc_syv682x.c
index 86f97bbb21..86f97bbb21 100644
--- a/zephyr/test/drivers/src/ppc_syv682x.c
+++ b/zephyr/test/drivers/default/src/ppc_syv682x.c
diff --git a/zephyr/test/drivers/src/ps8xxx.c b/zephyr/test/drivers/default/src/ps8xxx.c
index 7a37539c8e..7a37539c8e 100644
--- a/zephyr/test/drivers/src/ps8xxx.c
+++ b/zephyr/test/drivers/default/src/ps8xxx.c
diff --git a/zephyr/test/drivers/src/smart.c b/zephyr/test/drivers/default/src/smart.c
index 6de42efe9c..6de42efe9c 100644
--- a/zephyr/test/drivers/src/smart.c
+++ b/zephyr/test/drivers/default/src/smart.c
diff --git a/zephyr/test/drivers/src/stm_mems_common.c b/zephyr/test/drivers/default/src/stm_mems_common.c
index 26c00feaef..26c00feaef 100644
--- a/zephyr/test/drivers/src/stm_mems_common.c
+++ b/zephyr/test/drivers/default/src/stm_mems_common.c
diff --git a/zephyr/test/drivers/src/tcpci.c b/zephyr/test/drivers/default/src/tcpci.c
index 18a3341c27..18a3341c27 100644
--- a/zephyr/test/drivers/src/tcpci.c
+++ b/zephyr/test/drivers/default/src/tcpci.c
diff --git a/zephyr/test/drivers/src/tcpci_test_common.c b/zephyr/test/drivers/default/src/tcpci_test_common.c
index df2f14e3c4..df2f14e3c4 100644
--- a/zephyr/test/drivers/src/tcpci_test_common.c
+++ b/zephyr/test/drivers/default/src/tcpci_test_common.c
diff --git a/zephyr/test/drivers/src/tcs3400.c b/zephyr/test/drivers/default/src/tcs3400.c
index d7fcface36..d7fcface36 100644
--- a/zephyr/test/drivers/src/tcs3400.c
+++ b/zephyr/test/drivers/default/src/tcs3400.c
diff --git a/zephyr/test/drivers/src/temp_sensor.c b/zephyr/test/drivers/default/src/temp_sensor.c
index 4b63c6ab8a..4b63c6ab8a 100644
--- a/zephyr/test/drivers/src/temp_sensor.c
+++ b/zephyr/test/drivers/default/src/temp_sensor.c
diff --git a/zephyr/test/drivers/src/thermistor.c b/zephyr/test/drivers/default/src/thermistor.c
index 5a29ac7e89..5a29ac7e89 100644
--- a/zephyr/test/drivers/src/thermistor.c
+++ b/zephyr/test/drivers/default/src/thermistor.c
diff --git a/zephyr/test/drivers/src/uart_hostcmd.c b/zephyr/test/drivers/default/src/uart_hostcmd.c
index d599e76985..d599e76985 100644
--- a/zephyr/test/drivers/src/uart_hostcmd.c
+++ b/zephyr/test/drivers/default/src/uart_hostcmd.c
diff --git a/zephyr/test/drivers/src/usb_mux.c b/zephyr/test/drivers/default/src/usb_mux.c
index 8fdadd5cde..8fdadd5cde 100644
--- a/zephyr/test/drivers/src/usb_mux.c
+++ b/zephyr/test/drivers/default/src/usb_mux.c
diff --git a/zephyr/test/drivers/src/usb_pd_host_cmd.c b/zephyr/test/drivers/default/src/usb_pd_host_cmd.c
index bd421e7537..bd421e7537 100644
--- a/zephyr/test/drivers/src/usb_pd_host_cmd.c
+++ b/zephyr/test/drivers/default/src/usb_pd_host_cmd.c
diff --git a/zephyr/test/drivers/src/vboot_hash.c b/zephyr/test/drivers/default/src/vboot_hash.c
index ac23b95b02..ac23b95b02 100644
--- a/zephyr/test/drivers/src/vboot_hash.c
+++ b/zephyr/test/drivers/default/src/vboot_hash.c
diff --git a/zephyr/test/drivers/src/watchdog.c b/zephyr/test/drivers/default/src/watchdog.c
index bddde3fa50..bddde3fa50 100644
--- a/zephyr/test/drivers/src/watchdog.c
+++ b/zephyr/test/drivers/default/src/watchdog.c
diff --git a/zephyr/test/drivers/testcase.yaml b/zephyr/test/drivers/testcase.yaml
new file mode 100644
index 0000000000..d5ee114f8d
--- /dev/null
+++ b/zephyr/test/drivers/testcase.yaml
@@ -0,0 +1,24 @@
+common:
+ platform_allow: native_posix
+tests:
+ drivers.default:
+ extra_configs:
+ - CONFIG_LINK_TEST_SUITE_DEFAULT=y
+ - CONFIG_LINK_TEST_SUITE_USB_MALFUNCTION_SINK=y
+ drivers.ap_mux_control:
+ extra_args: CONF_FILE="prj.conf;ap_mux_control/prj.conf"
+ extra_configs:
+ - CONFIG_LINK_TEST_SUITE_AP_MUX_CONTROL=y
+ drivers.chargesplash:
+ extra_configs:
+ - CONFIG_LINK_TEST_SUITE_CHARGESPLASH=y
+ drivers.isl923x:
+ extra_configs:
+ - CONFIG_LINK_TEST_SUITE_ISL923X=y
+ drivers.led_driver:
+ extra_args: CONF_FILE="prj.conf;led_driver/prj.conf" DTC_OVERLAY_FILE="./boards/native_posix.overlay;./led_driver/led_pins.dts;./led_driver/led_policy.dts"
+ extra_configs:
+ - CONFIG_LINK_TEST_SUITE_LED_DRIVER=y
+ drivers.usbc_alt_mode:
+ extra_configs:
+ - CONFIG_LINK_TEST_SUITE_USBC_ALT_MODE=y \ No newline at end of file