Bug 1048446 - [mochitest] Check for a modules dir in the parent directory even if there is a build, r=gbrown

MozReview-Commit-ID: Jqyhbj7nC6z

--HG--
extra : rebase_source : 6fcc43388185d6dcaa313f2da4808521fe998653
This commit is contained in:
Andrew Halberstadt 2017-05-29 14:29:43 -04:00
parent c7ebd24d8e
commit 08935b6d52

View File

@ -765,24 +765,19 @@ class MochitestArguments(ArgumentContainer):
"data." % options.jscov_dir_prefix)
if options.testingModulesDir is None:
# Try to guess the testing modules directory.
possible = [os.path.join(here, os.path.pardir, 'modules')]
if build_obj:
options.testingModulesDir = os.path.join(
build_obj.topobjdir, '_tests', 'modules')
else:
# Try to guess the testing modules directory.
# This somewhat grotesque hack allows the buildbot machines to find the
# modules directory without having to configure the buildbot hosts. This
# code should never be executed in local runs because the build system
# should always set the flag that populates this variable. If buildbot ever
# passes this argument, this code can be deleted.
possible = os.path.join(here, os.path.pardir, 'modules')
possible.insert(0, os.path.join(build_obj.topobjdir, '_tests', 'modules'))
if os.path.isdir(possible):
options.testingModulesDir = possible
for p in possible:
if os.path.isdir(p):
options.testingModulesDir = p
break
if build_obj:
plugins_dir = os.path.join(build_obj.distdir, 'plugins')
if plugins_dir not in options.extraProfileFiles:
if os.path.isdir(plugins_dir) and plugins_dir not in options.extraProfileFiles:
options.extraProfileFiles.append(plugins_dir)
# Even if buildbot is updated, we still want this, as the path we pass in