summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-06-23 14:30:31 -0600
committerTom Rini <trini@konsulko.com>2024-07-04 09:25:21 -0600
commitf840a5b34ca181c4ecd8ee5c60a0a1bf5f8e559c (patch)
treedfa23374b19a08a95b5097f495fdbf11393c9900 /test
parent190933fbb56775f0415c885be38854cac41faaf2 (diff)
downloadu-boot-f840a5b34ca181c4ecd8ee5c60a0a1bf5f8e559c.tar.gz
u-boot-f840a5b34ca181c4ecd8ee5c60a0a1bf5f8e559c.tar.bz2
u-boot-f840a5b34ca181c4ecd8ee5c60a0a1bf5f8e559c.zip
test: Check help output
The current test doesn't check anything about the output. If a bug results in junk before the output, this is not currently detected. Add a check for the first line being the one expected. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_help.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/py/tests/test_help.py b/test/py/tests/test_help.py
index 153133cf28..2325ff6922 100644
--- a/test/py/tests/test_help.py
+++ b/test/py/tests/test_help.py
@@ -7,7 +7,11 @@ import pytest
def test_help(u_boot_console):
"""Test that the "help" command can be executed."""
- u_boot_console.run_command('help')
+ lines = u_boot_console.run_command('help')
+ if u_boot_console.config.buildconfig.get('config_cmd_2048', 'n') == 'y':
+ assert lines.splitlines()[0] == "2048 - The 2048 game"
+ else:
+ assert lines.splitlines()[0] == "? - alias for 'help'"
@pytest.mark.boardspec('sandbox')
def test_help_no_devicetree(u_boot_console):