summaryrefslogtreecommitdiff
path: root/selftest/wscript
diff options
context:
space:
mode:
authorMatthieu Patou <mat@matws.net>2014-10-12 17:57:20 -0700
committerMichael Adam <obnox@samba.org>2014-10-17 17:57:04 +0200
commitbdfcee6b8e457b8f5ecd0931e4cfb0473e4d78b3 (patch)
treebd69e18e66a293d68a611dae8922a330fa3ee9ef /selftest/wscript
parent4055eb6b7dbd845cfc431a2cf7f1867240046fdf (diff)
downloadsamba-bdfcee6b8e457b8f5ecd0931e4cfb0473e4d78b3.tar.gz
selftest: report the 10 slowest tests (by default) make the number configurable
Change-Id: Ib1cf50199d110827a25cf198b40738f3c72cbe17 Signed-off-by: Matthieu Patou <mat@matws.net> Reviewed-by: Jelmer Vernooij <jelmer@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'selftest/wscript')
-rw-r--r--selftest/wscript10
1 files changed, 10 insertions, 0 deletions
diff --git a/selftest/wscript b/selftest/wscript
index 7c6d3d79ace..e5df412d9d4 100644
--- a/selftest/wscript
+++ b/selftest/wscript
@@ -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)
@@ -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)