Skip to content

Commit

Permalink
selftest: report the 10 slowest tests (by default) make the number co…
Browse files Browse the repository at this point in the history
…nfigurable

Change-Id: Ib1cf50199d110827a25cf198b40738f3c72cbe17
Signed-off-by: Matthieu Patou <[email protected]>
Reviewed-by: Jelmer Vernooij <[email protected]>
Reviewed-by: Michael Adam <[email protected]>
  • Loading branch information
ekacnet authored and obnoxxx committed Oct 17, 2014
1 parent 4055eb6 commit bdfcee6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions selftest/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ def set_options(opt):
gr.add_option('--slow',
help=("enable the really slow tests"),
action="store_true", dest='SLOWTEST', default=False)
gr.add_option('--nb-slowest',
help=("Show the n slowest tests (default=10)"),
type=int, default=10, dest='NB_SLOWEST')
gr.add_option('--testenv',
help=("start a terminal with the test environment setup"),
action="store_true", dest='TESTENV', default=False)
Expand Down Expand Up @@ -232,6 +235,13 @@ def cmd_testonly(opt):
runcmd = EXPAND_VARIABLES(opt, testrcmd)
RUN_COMMAND(runcmd, env=env)

if os.path.exists("st/subunit"):
nb = Options.options.NB_SLOWEST
print "TOP %d slowest tests" % nb
cmd = "./script/show_testsuite_time %s/subunit %d" % (Options.options.SELFTEST_PREFIX, nb)
runcmd = EXPAND_VARIABLES(opt, cmd)
RUN_COMMAND(runcmd, env=env)

if ret != 0:
print("ERROR: test failed with exit code %d" % ret)
sys.exit(ret)
Expand Down

0 comments on commit bdfcee6

Please sign in to comment.