mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-01-25 11:25:17 +00:00
ba5e3e1ed0
The current event spy is always passed the event context and the event. The context is always NULL for a static spy. The event is not often used. Introduce a 'simple' spy which takes no arguments. This allows us to drop the adaptation code that many of these spy records use. Update the event script to find these in the image. Signed-off-by: Simon Glass <sjg@chromium.org>
23 lines
1.1 KiB
Python
23 lines
1.1 KiB
Python
# SPDX-License-Identifier: GPL-2.0+
|
|
# Copyright 2021 Google LLC
|
|
# Written by Simon Glass <sjg@chromium.org>
|
|
|
|
import pytest
|
|
import re
|
|
import u_boot_utils as util
|
|
|
|
# This is only a partial test - coverting 64-bit sandbox. It does not test
|
|
# big-endian images, nor 32-bit images
|
|
@pytest.mark.boardspec('sandbox')
|
|
def test_event_dump(u_boot_console):
|
|
"""Test that the "help" command can be executed."""
|
|
cons = u_boot_console
|
|
sandbox = cons.config.build_dir + '/u-boot'
|
|
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_MISC_INIT_F sandbox_misc_init_f .*arch/sandbox/cpu/start.c:.*
|
|
EVT_TEST h_adder_simple .*test/common/event.c:'''
|
|
assert re.match(expect, out, re.MULTILINE) is not None
|