[U-Boot] [PATCH v2 1/2] test/py: Allow to pass u_boot_log instead of console for run_and_log
Stephen Warren
swarren at wwwdotorg.org
Mon Dec 12 18:29:04 CET 2016
On 12/04/2016 05:52 PM, Stefan Brüns wrote:
> The runner actually has no console dependency, only on the log provided
> by the console. Accept both u_boot_console or a multiplexed_log.
Either this approach or updating all callers to always pass the log
object is fine by me. So if you need it,
Acked-by: Stephen Warren <swarren at nvidia.com>
One nit:
> diff --git a/test/py/u_boot_utils.py b/test/py/u_boot_utils.py
> + if hasattr(u_boot_console_or_log, 'get_runner'):
> + get_runner = u_boot_console_or_log.get_runner
> + else:
> + get_runner = u_boot_console_or_log.log.get_runner
> + runner = get_runner(cmd[0], sys.stdout)
> + if hasattr(u_boot_console_or_log, 'get_runner'):
> + get_runner = u_boot_console_or_log.get_runner
> + else:
> + get_runner = u_boot_console_or_log.log.get_runner
> + runner = get_runner(cmd[0], sys.stdout)
It would be nice to put that into a utility function so as not to
duplicate it, if you keep this approach.
More information about the U-Boot
mailing list