Bug 914327 - Mach command for b2g mochitests should handle test_path better, r=jgriffin, DONTBUILD, a=NPOTB

This commit is contained in:
Andrew Halberstadt 2013-09-11 14:53:47 -04:00
parent 06c33720be
commit 2734959955

View File

@ -65,6 +65,11 @@ class MochitestRunner(MozbuildObject):
# TODO Find adb automatically if it isn't on the path
raise Exception(ADB_NOT_FOUND % ('mochitest-remote', b2g_home))
# Need to call relpath before os.chdir() below.
test_path = ''
if test_file:
test_path = self._wrap_path_argument(test_file).relpath()
# TODO without os.chdir, chained imports fail below
os.chdir(self.mochitest_dir)
@ -86,8 +91,12 @@ class MochitestRunner(MozbuildObject):
options.httpdPath = self.mochitest_dir
options.xrePath = xre_path
if test_file:
options.testPath = test_file
if test_path:
test_root_file = mozpack.path.join(self.mochitest_dir, 'tests', test_path)
if not os.path.exists(test_root_file):
print('Specified test path does not exist: %s' % test_root_file)
return 1
options.testPath = test_path
else:
options.testManifest = 'b2g.json'