emul: Fuel gauge tests direct access to emul_sbs

The fuel gauge tests should *not* have to enable CONFIG_SENSOR in order to
get access to the sbs gauge emulator.

Allow fuel_gauge sbs_gauge direct access to emul_sbs_gauge.c

Signed-off-by: Aaron Massey <aaronmassey@google.com>
This commit is contained in:
Aaron Massey 2023-04-14 14:39:52 -06:00 committed by Carles Cufí
parent c2ec3d49cd
commit 75b2f5abed
7 changed files with 18 additions and 9 deletions

View file

@ -3,4 +3,4 @@ zephyr_library()
zephyr_library_sources(sbs_gauge.c)
zephyr_include_directories_ifdef(CONFIG_EMUL_SBS_GAUGE .)
zephyr_library_sources_ifdef(CONFIG_EMUL_SBS_GAUGE ../../sensor/sbs_gauge/emul_sbs_gauge.c)
zephyr_library_sources_ifdef(CONFIG_EMUL_SBS_GAUGE emul_sbs_gauge.c)

View file

@ -8,3 +8,5 @@ config SBS_GAUGE_NEW_API
select I2C
help
Enable I2C-based/SMBus-based driver for a Smart Battery Fuel Gauge.
rsource "Kconfig.emul_sbs_gauge"

View file

@ -0,0 +1,12 @@
# Copyright 2023 Google LLC
# SPDX-License-Identifier: Apache-2.0
# Keep this Kconfig separate from the fuel_gauge/sbs_gauge Kconfig so it may be shared with the
# sensor/sbs_gauge Kconfig.
config EMUL_SBS_GAUGE
bool "Emulate an SBS 1.1 compliant smart battery fuel gauge"
depends on EMUL
help
It provides readings which follow a simple sequence, thus allowing
test code to check that things are working as expected.

View file

@ -3,4 +3,4 @@ zephyr_library()
zephyr_library_sources(sbs_gauge.c)
zephyr_include_directories_ifdef(CONFIG_EMUL_SBS_GAUGE .)
zephyr_library_sources_ifdef(CONFIG_EMUL_SBS_GAUGE emul_sbs_gauge.c)
zephyr_library_sources_ifdef(CONFIG_EMUL_SBS_GAUGE ../../fuel_gauge/sbs_gauge/emul_sbs_gauge.c)

View file

@ -9,9 +9,5 @@ config SBS_GAUGE
help
Enable I2C-based/SMBus-based driver for a Smart Battery Fuel Gauge.
config EMUL_SBS_GAUGE
bool "Emulate an SBS 1.1 compliant smart battery fuel gauge"
depends on EMUL
help
It provides readings which follow a simple sequence, thus allowing
test code to check that things are working as expected.
# Maintain access to emul_sbs_gauge.
source "drivers/fuel_gauge/sbs_gauge/Kconfig.emul_sbs_gauge"

View file

@ -3,6 +3,5 @@ CONFIG_ZTEST_NEW_API=y
CONFIG_I2C=y
CONFIG_TEST_USERSPACE=y
CONFIG_LOG=y
CONFIG_SENSOR=y
CONFIG_FUEL_GAUGE=y