From a3f888fd798b5fd07a52b2296b37cb18c1c3b422 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Wed, 21 Oct 2026 13:22:26 +0200 Subject: [PATCH] tests: move application unit tests to tests/app Move the unit tests of the application next to the driver tests in tests/drivers, so that the tests directory only contains test suites in subdirectories. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/zephyr.yml | 2 +- tests/Kconfig | 2 -- tests/{ => app}/.gitignore | 0 tests/{ => app}/CMakeLists.txt | 14 +++++++------- tests/app/Kconfig | 2 ++ tests/{ => app}/boards/native_sim.overlay | 0 tests/{ => app}/prj.conf | 0 tests/{ => app}/src/daq_stub.h | 0 tests/{ => app}/src/main.cpp | 0 tests/{ => app}/src/tests.h | 0 tests/{ => app}/src/tests_bat_charger.cpp | 0 tests/{ => app}/src/tests_daq.cpp | 0 tests/{ => app}/src/tests_dcdc.cpp | 0 tests/{ => app}/src/tests_device_status.cpp | 0 tests/{ => app}/src/tests_load.cpp | 0 tests/{ => app}/src/tests_power_port.cpp | 0 16 files changed, 10 insertions(+), 10 deletions(-) delete mode 100644 tests/Kconfig rename tests/{ => app}/.gitignore (100%) rename tests/{ => app}/CMakeLists.txt (76%) create mode 100644 tests/app/Kconfig rename tests/{ => app}/boards/native_sim.overlay (100%) rename tests/{ => app}/prj.conf (100%) rename tests/{ => app}/src/daq_stub.h (100%) rename tests/{ => app}/src/main.cpp (100%) rename tests/{ => app}/src/tests.h (100%) rename tests/{ => app}/src/tests_bat_charger.cpp (100%) rename tests/{ => app}/src/tests_daq.cpp (100%) rename tests/{ => app}/src/tests_dcdc.cpp (100%) rename tests/{ => app}/src/tests_device_status.cpp (100%) rename tests/{ => app}/src/tests_load.cpp (100%) rename tests/{ => app}/src/tests_power_port.cpp (100%) diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index 53401f4..aaf79a9 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -45,7 +45,7 @@ jobs: - name: Run tests run: | - west build -b native_sim -t run tests -p + west build -b native_sim -t run tests/app -p - name: Run driver tests run: | diff --git a/tests/Kconfig b/tests/Kconfig deleted file mode 100644 index 6669869..0000000 --- a/tests/Kconfig +++ /dev/null @@ -1,2 +0,0 @@ - -rsource "../app/Kconfig" diff --git a/tests/.gitignore b/tests/app/.gitignore similarity index 100% rename from tests/.gitignore rename to tests/app/.gitignore diff --git a/tests/CMakeLists.txt b/tests/app/CMakeLists.txt similarity index 76% rename from tests/CMakeLists.txt rename to tests/app/CMakeLists.txt index d0788f9..fc587a5 100644 --- a/tests/CMakeLists.txt +++ b/tests/app/CMakeLists.txt @@ -1,8 +1,8 @@ # Copyright (c) The Libre Solar Project Contributors # SPDX-License-Identifier: Apache-2.0 -set(BOARD_ROOT ${CMAKE_SOURCE_DIR}/..) -set(DTS_ROOT ${CMAKE_SOURCE_DIR}/..) +set(BOARD_ROOT ${CMAKE_SOURCE_DIR}/../..) +set(DTS_ROOT ${CMAKE_SOURCE_DIR}/../..) #set(BOARD "native_posix") #set(ZEPHYR_TOOLCHAIN_VARIANT "host") @@ -15,16 +15,16 @@ add_definitions(-DUNIT_TEST=1) add_definitions(-DUNITY_OUTPUT_COLOR) add_definitions(-DUNITY_EXCLUDE_SETJMP) -add_subdirectory(../app/src build/app) +add_subdirectory(../../app/src build/app) zephyr_include_directories(./src) -zephyr_include_directories(../app/src) +zephyr_include_directories(../../app/src) -zephyr_include_directories(../../modules/thingset/src) -zephyr_include_directories(../../modules/unity/src) +zephyr_include_directories(../../../modules/thingset/src) +zephyr_include_directories(../../../modules/unity/src) target_sources(app PRIVATE - ../../modules/unity/src/unity.c + ../../../modules/unity/src/unity.c src/main.cpp src/tests_bat_charger.cpp src/tests_daq.cpp diff --git a/tests/app/Kconfig b/tests/app/Kconfig new file mode 100644 index 0000000..2e9957e --- /dev/null +++ b/tests/app/Kconfig @@ -0,0 +1,2 @@ + +rsource "../../app/Kconfig" diff --git a/tests/boards/native_sim.overlay b/tests/app/boards/native_sim.overlay similarity index 100% rename from tests/boards/native_sim.overlay rename to tests/app/boards/native_sim.overlay diff --git a/tests/prj.conf b/tests/app/prj.conf similarity index 100% rename from tests/prj.conf rename to tests/app/prj.conf diff --git a/tests/src/daq_stub.h b/tests/app/src/daq_stub.h similarity index 100% rename from tests/src/daq_stub.h rename to tests/app/src/daq_stub.h diff --git a/tests/src/main.cpp b/tests/app/src/main.cpp similarity index 100% rename from tests/src/main.cpp rename to tests/app/src/main.cpp diff --git a/tests/src/tests.h b/tests/app/src/tests.h similarity index 100% rename from tests/src/tests.h rename to tests/app/src/tests.h diff --git a/tests/src/tests_bat_charger.cpp b/tests/app/src/tests_bat_charger.cpp similarity index 100% rename from tests/src/tests_bat_charger.cpp rename to tests/app/src/tests_bat_charger.cpp diff --git a/tests/src/tests_daq.cpp b/tests/app/src/tests_daq.cpp similarity index 100% rename from tests/src/tests_daq.cpp rename to tests/app/src/tests_daq.cpp diff --git a/tests/src/tests_dcdc.cpp b/tests/app/src/tests_dcdc.cpp similarity index 100% rename from tests/src/tests_dcdc.cpp rename to tests/app/src/tests_dcdc.cpp diff --git a/tests/src/tests_device_status.cpp b/tests/app/src/tests_device_status.cpp similarity index 100% rename from tests/src/tests_device_status.cpp rename to tests/app/src/tests_device_status.cpp diff --git a/tests/src/tests_load.cpp b/tests/app/src/tests_load.cpp similarity index 100% rename from tests/src/tests_load.cpp rename to tests/app/src/tests_load.cpp diff --git a/tests/src/tests_power_port.cpp b/tests/app/src/tests_power_port.cpp similarity index 100% rename from tests/src/tests_power_port.cpp rename to tests/app/src/tests_power_port.cpp