[PATCH] tests/hwsim/run-tests.py: align stdout output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When running tests and all goes well, the output of run-tests looks like
this:

START the_first_test 1/2
PASS the_first_test 2.093176 2019-02-08 10:29:09.888411
START the_second_test 2/2
PASS the_second_test 0.640633 2019-02-08 10:29:10.530014

i.e. the test names are not aligned. This makes the output look a bit
messy to the human eye. In particular, it makes it difficult to quickly
get an idea of which tests have already run.

To fix this, add an extra space after the test result. The rest result
is always 4 characters: PASS, FAIL or SKIP. Adding a space aligns it
with the 5 characters of START.

This gives the much nicer output

START the_first_test 1/2
PASS  the_first_test 2.093176 2019-02-08 10:29:09.888411
START the_second_test 2/2
PASS  the_second_test 0.640633 2019-02-08 10:29:10.530014

Note that the alternative of adding a space in front was not chosen
because it draws focus to the START string while the test result is more
important.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@xxxxxxx>
---
 tests/hwsim/run-tests.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tests/hwsim/run-tests.py b/tests/hwsim/run-tests.py
index 43c30efae..2ada834bd 100755
--- a/tests/hwsim/run-tests.py
+++ b/tests/hwsim/run-tests.py
@@ -614,7 +614,7 @@ def main():
 
         report(conn, args.prefill, args.build, args.commit, run, name, result,
                diff.total_seconds(), args.logdir)
-        result = "{} {} {} {}".format(result, name, diff.total_seconds(), end)
+        result = "{}  {} {} {}".format(result, name, diff.total_seconds(), end)
         logger.info(result)
         if args.loglevel == logging.WARNING:
             print(result)
-- 
2.20.1


_______________________________________________
Hostap mailing list
Hostap@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/hostap



[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux