diff options
author | Jeremy Bettis <jbettis@google.com> | 2022-02-02 16:02:12 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2022-02-03 22:17:25 +0000 |
commit | cf69e095a410c95e74021ba274f1448765314e45 (patch) | |
tree | a04ce631fe3f39ee13c743041c18c6284e4077cb /zephyr/test/drivers/src/power_common.c | |
parent | c0c728d22621d6364d4bd62053adce4acc9424aa (diff) | |
download | chrome-ec-stabilize-14498.B-main.tar.gz |
zephyr: Support use of zephyr "dummy" consolestabilize-14498.B-main
Right now we only use the serial console in ec zephyr, however if you
want to check the output of a console command in a test, that is not
sufficient.
Add test only get_ec_shell() function that will give you the active
shell, whichever backend it might use.
Change console.c to setup the serial or dummy backends depending on
Kconfig.
Removed all calls to shell_backend_uart_get_ptr(), except for 1 in
console.c:init_ec_shell().
Switch test/drivers to SHELL_BACKEND_DUMMY.
Added some better failure logging in utils.c.
BRANCH=None
BUG=b:214256453
TEST=zmake testall
Signed-off-by: Jeremy Bettis <jbettis@google.com>
Change-Id: Ibafc37cc4363d1f20a919fa5e38325bd6a071eec
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3433630
Tested-by: Jeremy Bettis <jbettis@chromium.org>
Auto-Submit: Jeremy Bettis <jbettis@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Queue: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'zephyr/test/drivers/src/power_common.c')
-rw-r--r-- | zephyr/test/drivers/src/power_common.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/zephyr/test/drivers/src/power_common.c b/zephyr/test/drivers/src/power_common.c index 04250f6b77..d24537ba34 100644 --- a/zephyr/test/drivers/src/power_common.c +++ b/zephyr/test/drivers/src/power_common.c @@ -628,20 +628,20 @@ ZTEST(power_common_hibernation, test_power_cmd_hibernation_delay) /* Test success on call without argument */ zassert_equal(EC_SUCCESS, - shell_execute_cmd(shell_backend_uart_get_ptr(), + shell_execute_cmd(get_ec_shell(), "hibdelay"), NULL); /* Test error on hibernation delay argument that is not a number */ zassert_equal(EC_ERROR_PARAM1, - shell_execute_cmd(shell_backend_uart_get_ptr(), + shell_execute_cmd(get_ec_shell(), "hibdelay test1"), NULL); /* Set hibernate delay */ h_delay = 3; zassert_equal(EC_SUCCESS, - shell_execute_cmd(shell_backend_uart_get_ptr(), + shell_execute_cmd(get_ec_shell(), "hibdelay 3"), NULL); |