mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-17 10:24:49 +00:00
test/py: Show info about module-loading
It is sometimes tricky to figure out what modules test.py is loading when it starts up. The result can be a silent failure with no clue as to what when wrong. Add a section which lists the modules loaded as well as those not found. Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
d08653d369
commit
0043428777
1 changed files with 19 additions and 12 deletions
|
@ -289,19 +289,26 @@ def pytest_configure(config):
|
||||||
ubconfig = ArbitraryAttributeContainer()
|
ubconfig = ArbitraryAttributeContainer()
|
||||||
ubconfig.brd = dict()
|
ubconfig.brd = dict()
|
||||||
ubconfig.env = dict()
|
ubconfig.env = dict()
|
||||||
|
not_found = []
|
||||||
|
|
||||||
modules = [
|
with log.section('Loading lab modules', 'load_modules'):
|
||||||
(ubconfig.brd, 'u_boot_board_' + board_type_filename),
|
modules = [
|
||||||
(ubconfig.env, 'u_boot_boardenv_' + board_type_filename),
|
(ubconfig.brd, 'u_boot_board_' + board_type_filename),
|
||||||
(ubconfig.env, 'u_boot_boardenv_' + board_type_filename + '_' +
|
(ubconfig.env, 'u_boot_boardenv_' + board_type_filename),
|
||||||
board_identity_filename),
|
(ubconfig.env, 'u_boot_boardenv_' + board_type_filename + '_' +
|
||||||
]
|
board_identity_filename),
|
||||||
for (dict_to_fill, module_name) in modules:
|
]
|
||||||
try:
|
for (dict_to_fill, module_name) in modules:
|
||||||
module = __import__(module_name)
|
try:
|
||||||
except ImportError:
|
module = __import__(module_name)
|
||||||
continue
|
except ImportError:
|
||||||
dict_to_fill.update(module.__dict__)
|
not_found.append(module_name)
|
||||||
|
continue
|
||||||
|
dict_to_fill.update(module.__dict__)
|
||||||
|
log.info(f"Loaded {module}")
|
||||||
|
|
||||||
|
if not_found:
|
||||||
|
log.warning(f"Failed to find modules: {' '.join(not_found)}")
|
||||||
|
|
||||||
ubconfig.buildconfig = dict()
|
ubconfig.buildconfig = dict()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue