summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--zephyr/test/drivers/default/CMakeLists.txt1
-rw-r--r--zephyr/test/drivers/default/src/console_cmd/ec_features.c25
2 files changed, 26 insertions, 0 deletions
diff --git a/zephyr/test/drivers/default/CMakeLists.txt b/zephyr/test/drivers/default/CMakeLists.txt
index 73daf27c93..b4beea7e44 100644
--- a/zephyr/test/drivers/default/CMakeLists.txt
+++ b/zephyr/test/drivers/default/CMakeLists.txt
@@ -23,6 +23,7 @@ target_sources(app PRIVATE
src/console_cmd/button.c
src/console_cmd/crash.c
src/console_cmd/cutoff.c
+ src/console_cmd/ec_features.c
src/console_cmd/gpio.c
src/console_cmd/i2c_portmap.c
src/console_cmd/md.c
diff --git a/zephyr/test/drivers/default/src/console_cmd/ec_features.c b/zephyr/test/drivers/default/src/console_cmd/ec_features.c
new file mode 100644
index 0000000000..b33ca565bc
--- /dev/null
+++ b/zephyr/test/drivers/default/src/console_cmd/ec_features.c
@@ -0,0 +1,25 @@
+/* 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 "host_command.h"
+#include "test/drivers/test_state.h"
+#include "test/drivers/utils.h"
+
+ZTEST_SUITE(console_cmd_ec_features, drivers_predicate_post_main, NULL, NULL,
+ NULL, NULL);
+
+ZTEST_USER(console_cmd_ec_features, test_feat)
+{
+ char expected[32];
+
+ snprintf(expected, sizeof(expected), " 0-31: 0x%08x\r\n32-63: 0x%08x",
+ get_feature_flags0(), get_feature_flags1());
+
+ CHECK_CONSOLE_CMD("feat", expected, EC_SUCCESS);
+}