From 4f09b0afe364f271cbe081563329983f52267476 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20G=C5=82=C4=85b?= Date: Thu, 27 Feb 2025 14:01:22 +0100 Subject: [PATCH] tests: drivers: i2c: i2c_bme688: Extend upstream sample MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add test that reuses source code from "original" test that existing in the upstream Zephyr. Extend sample with configurations that rely on internal shields pca63565 and pca63566. Remove Twister alt-config for upstream test. Signed-off-by: Sebastian Głąb --- CODEOWNERS | 1 + tests/drivers/i2c/i2c_bme688/CMakeLists.txt | 13 ++++++++++ tests/drivers/i2c/i2c_bme688/Kconfig | 9 +++++++ tests/drivers/i2c/i2c_bme688/README.txt | 3 +++ tests/drivers/i2c/i2c_bme688/prj.conf | 2 ++ .../drivers/i2c/i2c_bme688/testcase.yaml | 24 +++++++++---------- 6 files changed, 40 insertions(+), 12 deletions(-) create mode 100644 tests/drivers/i2c/i2c_bme688/CMakeLists.txt create mode 100644 tests/drivers/i2c/i2c_bme688/Kconfig create mode 100644 tests/drivers/i2c/i2c_bme688/README.txt create mode 100644 tests/drivers/i2c/i2c_bme688/prj.conf rename {scripts/twister/alt/zephyr/tests => tests}/drivers/i2c/i2c_bme688/testcase.yaml (75%) diff --git a/CODEOWNERS b/CODEOWNERS index b17accaeeff7..fd01faf00bcc 100644 --- a/CODEOWNERS +++ b/CODEOWNERS @@ -834,6 +834,7 @@ /tests/drivers/flash/flash_rpc/ @nrfconnect/ncs-pluto /tests/drivers/flash_patch/ @nrfconnect/ncs-pluto /tests/drivers/fprotect/ @nrfconnect/ncs-pluto +/tests/drivers/i2c/i2c_bme688/ @nrfconnect/ncs-low-level-test /tests/drivers/lpuart/ @nordic-krch /tests/drivers/nrfx_integration_test/ @nrfconnect/ncs-co-drivers /tests/drivers/pwm/gpio_loopback/ @nrfconnect/ncs-low-level-test diff --git a/tests/drivers/i2c/i2c_bme688/CMakeLists.txt b/tests/drivers/i2c/i2c_bme688/CMakeLists.txt new file mode 100644 index 000000000000..57df1b50b17a --- /dev/null +++ b/tests/drivers/i2c/i2c_bme688/CMakeLists.txt @@ -0,0 +1,13 @@ +# +# Copyright (c) 2025 Nordic Semiconductor ASA +# +# SPDX-License-Identifier: LicenseRef-Nordic-5-Clause +# + +cmake_minimum_required(VERSION 3.20.0) + +find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE}) +project(i2c_bme688) + +FILE(GLOB app_sources ${ZEPHYR_BASE}/tests/drivers/i2c/i2c_bme688/src/*.c) +target_sources(app PRIVATE ${app_sources}) diff --git a/tests/drivers/i2c/i2c_bme688/Kconfig b/tests/drivers/i2c/i2c_bme688/Kconfig new file mode 100644 index 000000000000..7ae057ebafe7 --- /dev/null +++ b/tests/drivers/i2c/i2c_bme688/Kconfig @@ -0,0 +1,9 @@ +# I2C BME688 test configuration options +# Copyright (c) 2024 Nordic Semiconductor ASA +# SPDX-License-Identifier: Apache-2.0 + +config TEST_I2C_SPEED + int "Select I2C speed used during the test, selectable options are: I2C_SPEED_STANDARD (0x1U), I2C_SPEED_FAST (0x2U), I2C_SPEED_FAST_PLUS (0x3U)" + default 1 + +source "Kconfig.zephyr" diff --git a/tests/drivers/i2c/i2c_bme688/README.txt b/tests/drivers/i2c/i2c_bme688/README.txt new file mode 100644 index 000000000000..d75c627ba9b8 --- /dev/null +++ b/tests/drivers/i2c/i2c_bme688/README.txt @@ -0,0 +1,3 @@ +This sample extends the same-named Zephyr sample to verify it with Nordic development kits. + +Source code and basic configuration files can be found in the corresponding folder structure in zephyr/tests/drivers/i2c/i2c_bme688. diff --git a/tests/drivers/i2c/i2c_bme688/prj.conf b/tests/drivers/i2c/i2c_bme688/prj.conf new file mode 100644 index 000000000000..4b19609ecfbd --- /dev/null +++ b/tests/drivers/i2c/i2c_bme688/prj.conf @@ -0,0 +1,2 @@ +CONFIG_I2C=y +CONFIG_ZTEST=y diff --git a/scripts/twister/alt/zephyr/tests/drivers/i2c/i2c_bme688/testcase.yaml b/tests/drivers/i2c/i2c_bme688/testcase.yaml similarity index 75% rename from scripts/twister/alt/zephyr/tests/drivers/i2c/i2c_bme688/testcase.yaml rename to tests/drivers/i2c/i2c_bme688/testcase.yaml index dc4e3f21f8a7..cc20c8d82b85 100644 --- a/scripts/twister/alt/zephyr/tests/drivers/i2c/i2c_bme688/testcase.yaml +++ b/tests/drivers/i2c/i2c_bme688/testcase.yaml @@ -5,32 +5,32 @@ common: depends_on: i2c harness: ztest tests: - drivers.i2c.bme688_nrf54l: + nrf.extended.drivers.i2c.bme688_nrf54l: filter: not CONFIG_COVERAGE harness_config: fixture: pca63565 extra_args: - SHIELD=pca63565 - SB_CONFIG_VPR_LAUNCHER=y - - vpr_launcher_DTC_OVERLAY_FILE="../../../../nrf/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" + - vpr_launcher_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - drivers.i2c.bme688_nrf54l_fast_speed: + nrf.extended.drivers.i2c.bme688_nrf54l_fast_speed: filter: not CONFIG_COVERAGE harness_config: fixture: pca63565 extra_args: - SHIELD=pca63565 - SB_CONFIG_VPR_LAUNCHER=y - - vpr_launcher_DTC_OVERLAY_FILE="../../../../nrf/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" + - vpr_launcher_DTC_OVERLAY_FILE="${ZEPHYR_NRF_MODULE_DIR}/boards/shields/pca63565/boards/nrf54l15dk_nrf54l15_vpr_launcher.overlay" - CONFIG_TEST_I2C_SPEED=2 platform_allow: - nrf54l15dk/nrf54l15/cpuapp - nrf54l15dk/nrf54l15/cpuflpr - drivers.i2c.bme688_nrf54l_coverage: + nrf.extended.drivers.i2c.bme688_nrf54l_coverage: filter: CONFIG_COVERAGE harness_config: fixture: pca63565 @@ -39,7 +39,7 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - drivers.i2c.bme688_nrf54l_coverage_fast_speed: + nrf.extended.drivers.i2c.bme688_nrf54l_coverage_fast_speed: filter: CONFIG_COVERAGE harness_config: fixture: pca63565 @@ -49,7 +49,7 @@ tests: platform_allow: - nrf54l15dk/nrf54l15/cpuapp - drivers.i2c.bme688_nrf54h: + nrf.extended.drivers.i2c.bme688_nrf54h: filter: not CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -61,7 +61,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - drivers.i2c.bme688_nrf54h_fast_speed: + nrf.extended.drivers.i2c.bme688_nrf54h_fast_speed: filter: not CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -74,7 +74,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - drivers.i2c.bme688_nrf54h_fast_plus_speed: + nrf.extended.drivers.i2c.bme688_nrf54h_fast_plus_speed: filter: not CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -87,7 +87,7 @@ tests: - nrf54h20dk/nrf54h20/cpuapp - nrf54h20dk/nrf54h20/cpuppr - drivers.i2c.bme688_nrf54h_coverage: + nrf.extended.drivers.i2c.bme688_nrf54h_coverage: filter: CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -96,7 +96,7 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - drivers.i2c.bme688_nrf54h_coverage_fast_speed: + nrf.extended.drivers.i2c.bme688_nrf54h_coverage_fast_speed: filter: CONFIG_COVERAGE harness_config: fixture: pca63566 @@ -106,7 +106,7 @@ tests: platform_allow: - nrf54h20dk/nrf54h20/cpuapp - drivers.i2c.bme688_nrf54h_coverage_fast_plus_speed: + nrf.extended.drivers.i2c.bme688_nrf54h_coverage_fast_plus_speed: filter: CONFIG_COVERAGE harness_config: fixture: pca63566