blob: 84981305bf09849e3d5f8f133f38ce033c871bc7 [file] [log] [blame]
Simon Glass84015e52024-10-21 10:19:30 +02001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Test for 'meminfo' command
4 *
5 * Copyright 2024 Google LLC
6 * Written by Simon Glass <sjg@chromium.org>
7 */
8
9#include <dm/test.h>
10#include <test/cmd.h>
11#include <test/ut.h>
12
13/* Test 'meminfo' command */
14static int cmd_test_meminfo(struct unit_test_state *uts)
15{
16 ut_assertok(run_command("meminfo", 0));
17 ut_assert_nextline("DRAM: 256 MiB");
18 ut_assert_nextline_empty();
19
20 ut_assert_nextline("Region Base Size End Gap");
21 ut_assert_nextlinen("-");
22
23 /* For now we don't worry about checking the values */
24 ut_assert_nextlinen("video");
25 ut_assert_nextlinen("code");
26 ut_assert_nextlinen("malloc");
27 ut_assert_nextlinen("board_info");
28 ut_assert_nextlinen("global_data");
29 ut_assert_nextlinen("devicetree");
30 ut_assert_nextlinen("bootstage");
31 ut_assert_nextlinen("bloblist");
32 ut_assert_nextlinen("stack");
33 ut_assert_nextlinen("free");
34 ut_assert_console_end();
35
36 return 0;
37}
38CMD_TEST(cmd_test_meminfo, UTF_CONSOLE);