build: fix check for subunit file when selftest prefix is given
[kai/samba-autobuild/.git] / selftest / wscript
index 3e6dffcc35cae552bef970b533bc2fc7fde78626..fd925311a2a657fc71ec922dd7d3b49305faa0b7 100644 (file)
@@ -238,10 +238,11 @@ def cmd_testonly(opt):
         runcmd = EXPAND_VARIABLES(opt, testrcmd)
         RUN_COMMAND(runcmd, env=env)
 
-    if os.path.exists("st/subunit"):
+    subunit_file = "%s/subunit" % env.SELFTEST_PREFIX
+    if os.path.exists(subunit_file):
         nb = Options.options.NB_SLOWEST
         print "TOP %d slowest tests" % nb
-        cmd = "./script/show_testsuite_time %s/subunit %d" % (Options.options.SELFTEST_PREFIX, nb)
+        cmd = "./script/show_testsuite_time %s %d" % (subunit_file, nb)
         runcmd = EXPAND_VARIABLES(opt, cmd)
         RUN_COMMAND(runcmd, env=env)