summaryrefslogtreecommitdiff
path: root/zephyr
diff options
context:
space:
mode:
authorJeremy Bettis <jbettis@google.com>2021-04-12 09:49:53 -0600
committerCommit Bot <commit-bot@chromium.org>2021-04-20 05:12:23 +0000
commit7e92795c4bdd405abc1024a43f7ebc57eacd509f (patch)
tree25f865ea717b2a51e926210b44d4156bb8f0820b /zephyr
parentd1483c9f5fd9614be2cb6fe2c1faf580e11b118b (diff)
downloadchrome-ec-7e92795c4bdd405abc1024a43f7ebc57eacd509f.tar.gz
zephyr: Allow ztests to use shimmed tasks
There is no reason to prevent CONFIG_SHIMMED_TASKS and CONFIG_ZTEST from being used together. BUG=b:185118990 TEST=zmake testall BRANCH=none Signed-off-by: Jeremy Bettis <jbettis@google.com> Change-Id: I024ef0faea14fa9ddc38c5ca688e8fa4448691c2 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2821357 Tested-by: Jeremy Bettis <jbettis@chromium.org> Reviewed-by: Simon Glass <sjg@chromium.org> Commit-Queue: Jeremy Bettis <jbettis@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2839112 Tested-by: Eric Yilun Lin <yllin@chromium.org> Reviewed-by: Eric Yilun Lin <yllin@chromium.org> Commit-Queue: Eric Yilun Lin <yllin@chromium.org>
Diffstat (limited to 'zephyr')
-rw-r--r--zephyr/shim/include/shimmed_task_id.h6
-rw-r--r--zephyr/test/drivers/prj.conf1
-rw-r--r--zephyr/test/drivers/shimmed_test_tasks.h20
-rw-r--r--zephyr/test/drivers/src/stubs.c5
4 files changed, 8 insertions, 24 deletions
diff --git a/zephyr/shim/include/shimmed_task_id.h b/zephyr/shim/include/shimmed_task_id.h
index a57252cd66..c25d8c731e 100644
--- a/zephyr/shim/include/shimmed_task_id.h
+++ b/zephyr/shim/include/shimmed_task_id.h
@@ -14,10 +14,10 @@ typedef uint8_t task_id_t;
/*
* Highest priority on bottom -- same as in platform/ec. List of CROS_EC_TASK
* items. See CONFIG_TASK_LIST in platform/ec's config.h for more information.
- * This will only automatically get generated if CONFIG_ZTEST is not defined.
- * Unit tests must define their own tasks.
+ * For tests that want their own custom tasks, use CONFIG_HAS_TEST_TASKS and not
+ * CONFIG_SHIMMED_TASKS.
*/
-#ifndef CONFIG_ZTEST
+#ifdef CONFIG_SHIMMED_TASKS
#define CROS_EC_TASK_LIST \
COND_CODE_1(HAS_TASK_HOOKS, \
(CROS_EC_TASK(HOOKS, hook_task, 0, \
diff --git a/zephyr/test/drivers/prj.conf b/zephyr/test/drivers/prj.conf
index 89ca3b4c19..9eee0cde53 100644
--- a/zephyr/test/drivers/prj.conf
+++ b/zephyr/test/drivers/prj.conf
@@ -5,7 +5,6 @@
CONFIG_ZTEST=y
CONFIG_PLATFORM_EC=y
CONFIG_CROS_EC=y
-CONFIG_HAS_TEST_TASKS=y
CONFIG_SHIMMED_TASKS=y
CONFIG_EMUL=y
CONFIG_I2C=y
diff --git a/zephyr/test/drivers/shimmed_test_tasks.h b/zephyr/test/drivers/shimmed_test_tasks.h
deleted file mode 100644
index e78e4dac76..0000000000
--- a/zephyr/test/drivers/shimmed_test_tasks.h
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Copyright 2021 The Chromium OS Authors. All rights reserved.
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#ifndef __CROS_EC_SHIMMED_TEST_TASKS_H
-#define __CROS_EC_SHIMMED_TEST_TASKS_H
-
-/* Highest priority on bottom same as in platform/ec */
-#define CROS_EC_TASK_LIST \
- CROS_EC_TASK(HOOKS, hook_task, 0, CONFIG_TASK_HOOKS_STACK_SIZE) \
- CROS_EC_TASK(CHG_RAMP, chg_ramp_task, 0, \
- CONFIG_TASK_CHG_RAMP_STACK_SIZE) \
- CROS_EC_TASK(USB_CHG_P0, usb_charger_task, 0, \
- CONFIG_TASK_USB_CHG_STACK_SIZE) \
- CROS_EC_TASK(CHARGER, charger_task, 0, CONFIG_TASK_CHARGER_STACK_SIZE) \
- CROS_EC_TASK(HOSTCMD, host_command_task, 0, \
- CONFIG_TASK_HOSTCMD_STACK_SIZE) \
- CROS_EC_TASK(PD_C0, pd_task, 0, CONFIG_TASK_PD_STACK_SIZE)
-#endif /* __CROS_EC_SHIMMED_TEST_TASKS_H */
diff --git a/zephyr/test/drivers/src/stubs.c b/zephyr/test/drivers/src/stubs.c
index afa3f2f2d6..219fe73818 100644
--- a/zephyr/test/drivers/src/stubs.c
+++ b/zephyr/test/drivers/src/stubs.c
@@ -179,3 +179,8 @@ unsigned int ppc_cnt = ARRAY_SIZE(ppc_chips);
void system_hibernate(uint32_t seconds, uint32_t microseconds)
{
}
+
+uint16_t tcpc_get_alert_status(void)
+{
+ return 0;
+}