mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-21 06:31:31 +00:00
test: add test for dropped trace before log_init
Add test for dropped trace before log_init, displayed by debug uart. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
dd500134a4
commit
a4918b2310
2 changed files with 16 additions and 0 deletions
|
@ -9,6 +9,7 @@
|
||||||
#include <efi_loader.h>
|
#include <efi_loader.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <init.h>
|
#include <init.h>
|
||||||
|
#include <log.h>
|
||||||
#include <os.h>
|
#include <os.h>
|
||||||
#include <cli.h>
|
#include <cli.h>
|
||||||
#include <sort.h>
|
#include <sort.h>
|
||||||
|
@ -486,6 +487,10 @@ int main(int argc, char *argv[])
|
||||||
*/
|
*/
|
||||||
gd->reloc_off = (ulong)gd->arch.text_base;
|
gd->reloc_off = (ulong)gd->arch.text_base;
|
||||||
|
|
||||||
|
/* sandbox test: log functions called before log_init in board_init_f */
|
||||||
|
log_info("sandbox: starting...\n");
|
||||||
|
log_debug("debug: %s\n", __func__);
|
||||||
|
|
||||||
/* Do pre- and post-relocation init */
|
/* Do pre- and post-relocation init */
|
||||||
board_init_f(0);
|
board_init_f(0);
|
||||||
|
|
||||||
|
|
|
@ -36,3 +36,14 @@ def test_log_format(u_boot_console):
|
||||||
run_with_format('FLfm', 'file.c:123-func() msg')
|
run_with_format('FLfm', 'file.c:123-func() msg')
|
||||||
run_with_format('lm', 'NOTICE. msg')
|
run_with_format('lm', 'NOTICE. msg')
|
||||||
run_with_format('m', 'msg')
|
run_with_format('m', 'msg')
|
||||||
|
|
||||||
|
@pytest.mark.buildconfigspec('debug_uart')
|
||||||
|
@pytest.mark.boardspec('sandbox')
|
||||||
|
def test_log_dropped(u_boot_console):
|
||||||
|
"""Test dropped 'log' message when debug_uart is activated"""
|
||||||
|
|
||||||
|
cons = u_boot_console
|
||||||
|
cons.restart_uboot()
|
||||||
|
output = cons.get_spawn_output().replace('\r', '')
|
||||||
|
assert 'sandbox: starting...' in output
|
||||||
|
assert (not 'debug: main' in output)
|
||||||
|
|
Loading…
Add table
Reference in a new issue