Message ID | 1470008109-9699-8-git-send-email-sjg@chromium.org |
---|---|
State | Accepted |
Commit | 851271a71ada94d3ae52057c5cea465f4ba9f621 |
Delegated to: | Tom Rini |
Headers | show |
On 07/31/2016 05:35 PM, Simon Glass wrote: > Use 'cons.log.section' feature to split up the test output. This makes it > easier to read. > > Suggested-by: Stephen Warren <swarren@nvidia.com> > > Signed-off-by: Simon Glass <sjg@chromium.org> The same nit I mentioned before applies to a few other commits too, such as this one. > diff --git a/test/py/tests/test_vboot.py b/test/py/tests/test_vboot.py > - cons.log.action('%s: Test Verified Boot Run: %s' % (sha_algo, test_type)) > - output = cons.run_command_list( > - ['sb load hostfs - 100 %stest.fit' % tmpdir, > - 'fdt addr 100', > - 'bootm 100']) > + with cons.log.section('Verified boot %s %s' % (sha_algo, test_type)): > + output = cons.run_command_list( > + ['sb load hostfs - 100 %stest.fit' % tmpdir, > + 'fdt addr 100', > + 'bootm 100']) > assert(expect_string in output) I'd suggest putting the assert inside the "with" block too, so that any error messages it raises are part of that block.
On Sun, Jul 31, 2016 at 05:35:07PM -0600, Simon Glass wrote: > Use 'cons.log.section' feature to split up the test output. This makes it > easier to read. > > Suggested-by: Stephen Warren <swarren@nvidia.com> > > Signed-off-by: Simon Glass <sjg@chromium.org> Applied to u-boot/master, thanks!
diff --git a/test/py/tests/test_vboot.py b/test/py/tests/test_vboot.py index a5032a7..25c3a53 100644 --- a/test/py/tests/test_vboot.py +++ b/test/py/tests/test_vboot.py @@ -67,11 +67,11 @@ def test_vboot(u_boot_console): """ cons.cleanup_spawn() cons.ensure_spawned() - cons.log.action('%s: Test Verified Boot Run: %s' % (sha_algo, test_type)) - output = cons.run_command_list( - ['sb load hostfs - 100 %stest.fit' % tmpdir, - 'fdt addr 100', - 'bootm 100']) + with cons.log.section('Verified boot %s %s' % (sha_algo, test_type)): + output = cons.run_command_list( + ['sb load hostfs - 100 %stest.fit' % tmpdir, + 'fdt addr 100', + 'bootm 100']) assert(expect_string in output) def make_fit(its):
Use 'cons.log.section' feature to split up the test output. This makes it easier to read. Suggested-by: Stephen Warren <swarren@nvidia.com> Signed-off-by: Simon Glass <sjg@chromium.org> --- test/py/tests/test_vboot.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)