blob: 53b41e3b49e01c308ae2338c906496f162dc7a27 [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");
Simon Glass9b259c52024-10-21 10:19:32 +020033
34 /* we expect at least one lmb line, but don't know how many */
35 ut_assert_nextlinen("lmb");
36 ut_assert_skip_to_linen("free");
37
Simon Glass84015e52024-10-21 10:19:30 +020038 ut_assert_console_end();
39
40 return 0;
41}
42CMD_TEST(cmd_test_meminfo, UTF_CONSOLE);