summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorPeter Marheine <pmarheine@chromium.org>2019-12-20 11:33:40 -0800
committerCommit Bot <commit-bot@chromium.org>2020-01-08 06:29:05 +0000
commit544ee3c5461b6f00115887122f4ad5a29d0ed6bc (patch)
treebe114b0c8be4a89c2cd323719daea58ef586d051 /test
parent10ef2ab040528aca0e04716a844d5db96043e145 (diff)
downloadchrome-ec-544ee3c5461b6f00115887122f4ad5a29d0ed6bc.tar.gz
battery: stub out battery_is_present if disabled
There are a number of potential callers that care if there is a battery, but for boards that don't support batteries (chromeboxes) we can let them skip implementing this stub. Tests default to battery present, but they can provide their own per-test implementation if desired. Some PD battery presence checks have been disabled when battery support is disabled; these are irrelevant when there is no battery, and they cause linking failures because they depend on both the charge manager and battery presence. BUG=b:146504182 BRANCH=none TEST=buildall Change-Id: Ifad6a9e356c8ac2146b09bc83b359a7c55adc1a7 Signed-off-by: Peter Marheine <pmarheine@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1980099 Reviewed-by: Scott Collyer <scollyer@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/build.mk2
-rw-r--r--test/charge_manager.c5
-rw-r--r--test/usb_pd.c5
3 files changed, 1 insertions, 11 deletions
diff --git a/test/build.mk b/test/build.mk
index aa6b6b4483..319bfc038c 100644
--- a/test/build.mk
+++ b/test/build.mk
@@ -151,7 +151,7 @@ thermal-y=thermal.o
timer_calib-y=timer_calib.o
timer_dos-y=timer_dos.o
uptime-y=uptime.o
-usb_common-y=usb_common_test.o
+usb_common-y=usb_common_test.o fake_battery.o
usb_pd_int-y=usb_pd_int.o
usb_pd-y=usb_pd.o
usb_pd_giveback-y=usb_pd.o
diff --git a/test/charge_manager.c b/test/charge_manager.c
index 7fb8685aef..9ac87aa11d 100644
--- a/test/charge_manager.c
+++ b/test/charge_manager.c
@@ -70,11 +70,6 @@ void pd_set_new_power_request(int port)
new_power_request[port] = 1;
}
-enum battery_present battery_is_present(void)
-{
- return BP_YES;
-}
-
static void clear_new_power_requests(void)
{
int i;
diff --git a/test/usb_pd.c b/test/usb_pd.c
index 6ec9b3ffda..c009bdf7bb 100644
--- a/test/usb_pd.c
+++ b/test/usb_pd.c
@@ -48,11 +48,6 @@ uint16_t pd_get_identity_pid(int port)
return 0;
}
-enum battery_present battery_is_present(void)
-{
- return BP_YES;
-}
-
int battery_status(int *status)
{
*status = 1;