summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2024-06-23 23:30:28 +0300
committerTom Rini <trini@konsulko.com>2024-07-04 18:25:21 +0300
commit1956785bf270036c8fa54f965924d65dcd02fd3f (patch)
treefeef78cb783e742ae629c8cc1afa628375ccaac5 /test
parentdee65403cc78807a7f6ef19af536d6fd1fd2823d (diff)
downloadu-boot-1956785bf270036c8fa54f965924d65dcd02fd3f.tar.xz
log: Allow tests to pass with CONFIG_LOGF_FUNC_PAD set
This setting pads out the function names. Adjust the test to handle this, since some boards use it. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'test')
-rw-r--r--test/py/tests/test_log.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/test/py/tests/test_log.py b/test/py/tests/test_log.py
index 140dcb9aa2..79808674bb 100644
--- a/test/py/tests/test_log.py
+++ b/test/py/tests/test_log.py
@@ -27,13 +27,16 @@ def test_log_format(u_boot_console):
cons = u_boot_console
with cons.log.section('format'):
- run_with_format('all', 'NOTICE.arch,file.c:123-func() msg')
+ pad = int(u_boot_console.config.buildconfig.get('config_logf_func_pad'))
+ padding = ' ' * (pad - len('func'))
+
+ run_with_format('all', f'NOTICE.arch,file.c:123-{padding}func() msg')
output = cons.run_command('log format')
assert output == 'Log format: clFLfm'
- run_with_format('fm', 'func() msg')
- run_with_format('clfm', 'NOTICE.arch,func() msg')
- run_with_format('FLfm', 'file.c:123-func() msg')
+ run_with_format('fm', f'{padding}func() msg')
+ run_with_format('clfm', f'NOTICE.arch,{padding}func() msg')
+ run_with_format('FLfm', f'file.c:123-{padding}func() msg')
run_with_format('lm', 'NOTICE. msg')
run_with_format('m', 'msg')