test_event_dump.py 1021 B

12345678910111213141516171819202122
  1. # SPDX-License-Identifier: GPL-2.0+
  2. # Copyright 2021 Google LLC
  3. # Written by Simon Glass <sjg@chromium.org>
  4. import pytest
  5. import re
  6. import u_boot_utils as util
  7. # This is only a partial test - coverting 64-bit sandbox. It does not test
  8. # big-endian images, nor 32-bit images
  9. @pytest.mark.boardspec('sandbox')
  10. def test_event_dump(u_boot_console):
  11. """Test that the "help" command can be executed."""
  12. cons = u_boot_console
  13. sandbox = cons.config.build_dir + '/u-boot'
  14. out = util.run_and_log(cons, ['scripts/event_dump.py', sandbox])
  15. expect = '''.*Event type Id Source location
  16. -------------------- ------------------------------ ------------------------------
  17. EVT_FT_FIXUP bootmeth_vbe_ft_fixup .*boot/vbe_request.c:.*
  18. EVT_FT_FIXUP bootmeth_vbe_simple_ft_fixup .*boot/vbe_simple_os.c:.*
  19. EVT_MISC_INIT_F sandbox_misc_init_f .*arch/sandbox/cpu/start.c:'''
  20. assert re.match(expect, out, re.MULTILINE) is not None