From 2a7473db80606ccffc60d3d5f8eb2ff8be9d0dc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20J=C3=A4ger?= Date: Wed, 21 Oct 2026 13:47:01 +0200 Subject: [PATCH] ci: run all tests with twister Run the application unit tests and the driver tests with a single twister call and update the documentation accordingly. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/zephyr.yml | 6 +----- docs/src/dev/unit_tests.rst | 21 +++++++++++++++++---- docs/src/dev/workspace_setup.rst | 1 + 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/.github/workflows/zephyr.yml b/.github/workflows/zephyr.yml index aaf79a9..14f2adf 100644 --- a/.github/workflows/zephyr.yml +++ b/.github/workflows/zephyr.yml @@ -45,8 +45,4 @@ jobs: - name: Run tests run: | - west build -b native_sim -t run tests/app -p - - - name: Run driver tests - run: | - west twister -T tests/drivers --integration --inline-logs + west twister -T tests --integration --inline-logs diff --git a/docs/src/dev/unit_tests.rst b/docs/src/dev/unit_tests.rst index 8637cd3..d8a21d7 100644 --- a/docs/src/dev/unit_tests.rst +++ b/docs/src/dev/unit_tests.rst @@ -1,13 +1,26 @@ Unit Tests ========== -Core functions of the firmware are covered by unit-tests (located in ``tests`` directory). Build -and run the tests with the following command: +Core functions of the firmware are covered by unit tests based on the Zephyr ztest framework. The +tests are located in the ``tests`` directory: + +- ``tests/app``: Unit tests of the application (charger, DC/DC control, load output, etc.) +- ``tests/drivers``: Tests of the drivers in this repository + +All tests are run on ``native_sim`` with emulated drivers using twister: .. code-block:: bash - cd tests - west build -p -b native_posix -t run + west twister -T tests --integration + +The driver tests are additionally built (but not run) for some of the boards to ensure that the +drivers compile for all supported MCUs. + +The firmware can be built for all boards and board revisions in the same way: + +.. code-block:: bash + + west twister -T app --integration Conformance testing diff --git a/docs/src/dev/workspace_setup.rst b/docs/src/dev/workspace_setup.rst index b725255..ad2585a 100644 --- a/docs/src/dev/workspace_setup.rst +++ b/docs/src/dev/workspace_setup.rst @@ -25,6 +25,7 @@ Afterwards, most important folders in your workspace will look like this: ├── charge-controller-firmware/ # application firmware repository │ ├── app/ # application source files │ ├── boards/ # board specifications + │ ├── drivers/ # driver source files │ ├── tests/ # unit test source files │ └── west.yml # main manifest file │