[PATCH 10/20] tests/test_event_dump: Relax match rule for output

Jiaxun Yang jiaxun.yang at flygoat.com
Tue Jun 11 23:04:09 CEST 2024


event_dump.py relies on addr2line to obtain source location
information, however newer addr2line is unable to determine
line numbers for some functions.

With addr2line from binutils 2.34 we got:

Event type            Id                              Source location
--------------------  ------------------------------  ------------------------------
EVT_FT_FIXUP          bootmeth_vbe_ft_fixup           :?
EVT_FT_FIXUP          bootmeth_vbe_simple_ft_fixup    :?
EVT_LAST_STAGE_INIT   install_smbios_table            :?
EVT_MISC_INIT_F       sandbox_early_getopt_check      arch/sandbox/cpu/start.c:61
EVT_TEST              h_adder_simple                  :?

Which will fail the test.

Relax the source location regex to .*:.*, this is sufficent to
show that addr2line is being called and returned a possible
line number.

Signed-off-by: Jiaxun Yang <jiaxun.yang at flygoat.com>
---
 test/py/tests/test_event_dump.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/test/py/tests/test_event_dump.py b/test/py/tests/test_event_dump.py
index e282c67335cd..e87825abcd1a 100644
--- a/test/py/tests/test_event_dump.py
+++ b/test/py/tests/test_event_dump.py
@@ -16,9 +16,9 @@ def test_event_dump(u_boot_console):
     out = util.run_and_log(cons, ['scripts/event_dump.py', sandbox])
     expect = '''.*Event type            Id                              Source location
 --------------------  ------------------------------  ------------------------------
-EVT_FT_FIXUP          bootmeth_vbe_ft_fixup           .*boot/vbe_request.c:.*
-EVT_FT_FIXUP          bootmeth_vbe_simple_ft_fixup    .*boot/vbe_simple_os.c:.*
-EVT_LAST_STAGE_INIT   install_smbios_table            .*lib/efi_loader/efi_smbios.c:.*
-EVT_MISC_INIT_F       sandbox_early_getopt_check      .*arch/sandbox/cpu/start.c:.*
-EVT_TEST              h_adder_simple                  .*test/common/event.c:'''
+EVT_FT_FIXUP          bootmeth_vbe_ft_fixup           .*:.*
+EVT_FT_FIXUP          bootmeth_vbe_simple_ft_fixup    .*:.*
+EVT_LAST_STAGE_INIT   install_smbios_table            .*:.*
+EVT_MISC_INIT_F       sandbox_early_getopt_check      .*:.*
+EVT_TEST              h_adder_simple                  .*:'''
     assert re.match(expect, out, re.MULTILINE) is not None

-- 
2.43.0



More information about the U-Boot mailing list