summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Semjonovs <asemjonovs@google.com>2022-10-12 09:08:44 -0600
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-10-12 21:12:10 +0000
commit065186ef2ce243f12c729ff55c244b666aa44532 (patch)
tree5f42c88693b60e74455c3941c0f5c1b5b1327263
parent65da9cc08766e307e5d288e1d7848c83384dae21 (diff)
downloadchrome-ec-065186ef2ce243f12c729ff55c244b666aa44532.tar.gz
zephyr: Test shmem console command
Validate shmem console command BUG=None BRANCH=NONE TEST=./twister -T zephyr/test Signed-off-by: Al Semjonovs <asemjonovs@google.com> Change-Id: Ic17cd5bd2448a45795b6525502565a7fceb06b08 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3949472 Reviewed-by: Jeremy Bettis <jbettis@chromium.org> Code-Coverage: Zoss <zoss-cl-coverage@prod.google.com> Commit-Queue: Jeremy Bettis <jbettis@chromium.org>
-rw-r--r--zephyr/test/drivers/default/CMakeLists.txt1
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/shared_mem.c24
2 files changed, 25 insertions, 0 deletions
diff --git a/zephyr/test/drivers/default/CMakeLists.txt b/zephyr/test/drivers/default/CMakeLists.txt
index b4beea7e44..5a29365a40 100644
--- a/zephyr/test/drivers/default/CMakeLists.txt
+++ b/zephyr/test/drivers/default/CMakeLists.txt
@@ -36,6 +36,7 @@ target_sources(app PRIVATE
src/console_cmd/power_button.c
src/console_cmd/rtc.c
src/console_cmd/rw.c
+ src/console_cmd/shared_mem.c
src/console_cmd/sleepmask.c
src/console_cmd/sleeptimeout.c
src/console_cmd/sysinfo.c
diff --git a/zephyr/test/drivers/default/src/console_cmd/shared_mem.c b/zephyr/test/drivers/default/src/console_cmd/shared_mem.c
new file mode 100644
index 0000000000..e7b9396509
--- /dev/null
+++ b/zephyr/test/drivers/default/src/console_cmd/shared_mem.c
@@ -0,0 +1,24 @@
+/* Copyright 2022 The ChromiumOS Authors
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#include <zephyr/shell/shell.h>
+#include <zephyr/ztest.h>
+
+#include "console.h"
+#include "shared_mem.h"
+#include "test/drivers/test_state.h"
+#include "test/drivers/utils.h"
+
+ZTEST_SUITE(console_cmd_shared_mem, drivers_predicate_post_main, NULL, NULL,
+ NULL, NULL);
+
+ZTEST_USER(console_cmd_shared_mem, test_shmem)
+{
+ char expected[32];
+
+ snprintf(expected, sizeof(expected), "Size:%6d", shared_mem_size());
+
+ CHECK_CONSOLE_CMD("shmem", expected, EC_SUCCESS);
+}