summaryrefslogtreecommitdiff
path: root/test/cmd/meminfo.c
diff options
context:
space:
mode:
authorFrank Wunderlich <[email protected]>2026-02-04 19:40:43 +0100
committerTom Rini <[email protected]>2026-02-07 11:51:33 -0600
commit8acc8a654643ca26b0bdd4af37010da7cc796753 (patch)
treefc5d6b59da6341f2464fad36e603d390e6066df1 /test/cmd/meminfo.c
parente202eca183b0f1d6747b934482dc6249abdd742b (diff)
test: cmd: add test for memsize
Add a test for memsize command in same way as meminfo. Signed-off-by: Frank Wunderlich <[email protected]>
Diffstat (limited to 'test/cmd/meminfo.c')
-rw-r--r--test/cmd/meminfo.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/cmd/meminfo.c b/test/cmd/meminfo.c
index 40c3520496e..af2c19fa67d 100644
--- a/test/cmd/meminfo.c
+++ b/test/cmd/meminfo.c
@@ -7,6 +7,7 @@
*/
#include <dm/test.h>
+#include <env.h>
#include <test/cmd.h>
#include <test/ut.h>
@@ -39,4 +40,23 @@ static int cmd_test_meminfo(struct unit_test_state *uts)
return 0;
}
+
CMD_TEST(cmd_test_meminfo, UTF_CONSOLE);
+
+/* Test 'memsize' command */
+#ifdef CONFIG_CMD_MEMSIZE
+static int cmd_test_memsize(struct unit_test_state *uts)
+{
+ ut_assertok(run_command("memsize", 0));
+ ut_assert_nextline("256 MiB");
+ ut_assert_console_end();
+
+ ut_assertok(run_command("memsize memsz", 0));
+ ut_asserteq_str("256", env_get("memsz"));
+ ut_assert_console_end();
+
+ return 0;
+}
+
+CMD_TEST(cmd_test_memsize, UTF_CONSOLE);
+#endif