зеркало из https://github.com/mozilla/gecko-dev.git
Bug 878043 - allow get_binary_path to return a path for any binary. r=glandium
This commit is contained in:
Родитель
4b21d3fcfc
Коммит
1c90df8a68
|
@ -272,13 +272,7 @@ class MozbuildObject(ProcessExecutionMixin):
|
|||
|
||||
leaf = None
|
||||
|
||||
if what == 'app':
|
||||
leaf = substs['MOZ_APP_NAME'] + substs['BIN_SUFFIX']
|
||||
elif what == 'xpcshell':
|
||||
leaf = 'xpcshell'
|
||||
else:
|
||||
raise Exception("Don't know how to locate binary: %s" % what)
|
||||
|
||||
leaf = (substs['MOZ_APP_NAME'] if what == 'app' else what) + substs['BIN_SUFFIX']
|
||||
path = os.path.join(stem, leaf)
|
||||
|
||||
if validate_exists and not os.path.exists(path):
|
||||
|
|
|
@ -118,6 +118,12 @@ class TestMozbuildObject(unittest.TestCase):
|
|||
|
||||
self.assertRaises(Exception, base.get_binary_path, where="somewhere")
|
||||
|
||||
p = base.get_binary_path('foobar', validate_exists=False)
|
||||
if platform.startswith('win32'):
|
||||
self.assertTrue(p.endswith('foobar.exe'))
|
||||
else:
|
||||
self.assertTrue(p.endswith('foobar'))
|
||||
|
||||
class TestPathArgument(unittest.TestCase):
|
||||
def test_path_argument(self):
|
||||
# Absolute path
|
||||
|
|
Загрузка…
Ссылка в новой задаче