diff options
author | Yuval Peress <peress@chromium.org> | 2020-12-26 20:13:00 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2020-12-28 17:17:25 +0000 |
commit | 7cf197d455b3afc565f03abf0b911fd4a208a52e (patch) | |
tree | 0ea7e549efec7989279b6268f8256e63cfab76b7 /zephyr/test | |
parent | 51d7054e1bf0f1e5c5036eba09872033b1a14fa3 (diff) | |
download | chrome-ec-7cf197d455b3afc565f03abf0b911fd4a208a52e.tar.gz |
zephyr: tasks: Fix collision of shimmed_tasks.h
The issue here was initially found in https://crrev.com/c/2602440
where it was difficult (also not guaranteed to work) to declare
custom tasks for tests. The issue was that in zephyr/test/tasks/
the file shimmed_tasks.h was used which is intended to replace
zephyr/shim/include/shimmed_tasks.h. So far we've been lucky in
that the build was resolving this to the test instance, but this
is not guaranteed.
This change does the following:
1. If running CONFIG_ZTEST then we add a new CONFIG_HAS_TEST_TASKS
option that is defaulted to 'n'.
2. If CONFIG_HAS_TEST_TASKS is set to 'y', then we'll try to include
shimmed_test_tasks.h which should be defined by the test and added
somewhere in the include path (see zephyr/test/tasks/ for example).
3. We can now define custom tasks for tests. Note that in zephyr we
can just use normal tasks via CROS_EC_TASK and don't need to use a
special macro for test tasks.
BRANCH=none
BUG=b:172240633
TEST=zmake testall
Signed-off-by: Yuval Peress <peress@chromium.org>
Change-Id: Ib99c8ec08923a7e958e045d45d1aa2ec5e841ed5
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2603458
Reviewed-by: Paul Fagerburg <pfagerburg@chromium.org>
Commit-Queue: Paul Fagerburg <pfagerburg@chromium.org>
Diffstat (limited to 'zephyr/test')
-rw-r--r-- | zephyr/test/tasks/prj.conf | 1 | ||||
-rw-r--r-- | zephyr/test/tasks/shimmed_test_tasks.h (renamed from zephyr/test/tasks/shimmed_tasks.h) | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/zephyr/test/tasks/prj.conf b/zephyr/test/tasks/prj.conf index 572ee9bb25..d2cdafda60 100644 --- a/zephyr/test/tasks/prj.conf +++ b/zephyr/test/tasks/prj.conf @@ -3,4 +3,5 @@ # found in the LICENSE file. CONFIG_ZTEST=y +CONFIG_HAS_TEST_TASKS=y CONFIG_POLL=y diff --git a/zephyr/test/tasks/shimmed_tasks.h b/zephyr/test/tasks/shimmed_test_tasks.h index df3f7ceef0..268b452983 100644 --- a/zephyr/test/tasks/shimmed_tasks.h +++ b/zephyr/test/tasks/shimmed_test_tasks.h @@ -3,8 +3,8 @@ * found in the LICENSE file. */ -#ifndef __CROS_EC_SHIMMED_TASKS_H -#define __CROS_EC_SHIMMED_TASKS_H +#ifndef __CROS_EC_SHIMMED_TEST_TASKS_H +#define __CROS_EC_SHIMMED_TEST_TASKS_H /* * Manually define these HAS_TASK_* defines. There is a build time assert @@ -17,4 +17,4 @@ CROS_EC_TASK(TASK_1, task1_entry, 0, 512) \ CROS_EC_TASK(TASK_2, task2_entry, 0, 512) -#endif /* __CROS_EC_SHIMMED_TASKS_H */ +#endif /* __CROS_EC_SHIMMED_TEST_TASKS_H */ |